diff --git a/Access.Ace.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.Odbc.LinqService).sql new file mode 100644 index 000000000000..caf352ac51a3 --- /dev/null +++ b/Access.Ace.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.Odbc.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Ace.Odbc AccessODBC (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Ace.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.Odbc.LinqService).sql new file mode 100644 index 000000000000..c62ae8d33a24 --- /dev/null +++ b/Access.Ace.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.Odbc.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Ace.Odbc AccessODBC (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Ace.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc.LinqService).sql index ae90929aaa63..cf4963ae264c 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc.LinqService).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc.LinqService).sql index ef8726ce7511..61c4cca9e343 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc.LinqService).sql index 3876c89b7fd8..490a98b58d4c 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc.LinqService).sql index b9421c1b14db..3740e91e8867 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc.LinqService).sql index a6eeb4b617de..1860d2ce4c4a 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc.LinqService).sql index eaadede44f9b..4485b20f5035 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc.LinqService).sql index d568cce9d2bb..383fa2d74033 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc.LinqService).sql index d568cce9d2bb..383fa2d74033 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc.LinqService).sql index 22ddb5a14f37..d769c40f9cfd 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc.LinqService).sql index a22cc73f7360..cf51c244f8b0 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc.LinqService).sql index 0ff18c176363..7b91122de93a 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc.LinqService).sql index 18b313fd3010..837e5fbc8b6e 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc.LinqService).sql index 18b313fd3010..837e5fbc8b6e 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc.LinqService).sql index a5c41658379b..87ad02e3c3fd 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc.LinqService).sql index c2a58c8bad87..4b49d6709ae9 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc.LinqService).sql index 89cecccf2593..8fb34c248857 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc.LinqService).sql index 189c93529c13..6c81905d666a 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc.LinqService).sql index e89f9fc332c1..12aabc922baa 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc.LinqService).sql index 624ebd1d1d47..3d7ad553e14a 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 2 FROM [Parent] [p] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc.LinqService).sql index f5b9d35e5510..7c23c576ce85 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 4 FROM [Parent] [p] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc.LinqService).sql index 2a9b09ef8301..54cdaa922c90 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc.LinqService).sql index d22f55340cfe..3ad31b6a9c20 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc.LinqService).sql @@ -2,17 +2,17 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc.LinqService).sql index 4aefd212cd91..5afd2dda5d14 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc.LinqService).sql index 8f576552fb12..cc8320c7acb7 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc.LinqService).sql index 31bac54a2c51..e864651ecc7c 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc.LinqService).sql index 6d6a4e3050cd..63cd915ff0cb 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc.LinqService).sql index 4397cc265d3c..5b800c9274c4 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc.LinqService).sql index bdf46a439d59..53c81bde61cf 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,1).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,1).sql index d8e40eaa4941..91ab3608abd9 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,1).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,2).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,2).sql index d8e40eaa4941..91ab3608abd9 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,2).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,1).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,1).sql index 4397cc265d3c..5b800c9274c4 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,1).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,2).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,2).sql index 4397cc265d3c..5b800c9274c4 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,2).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc.LinqService).sql index 6d6a4e3050cd..63cd915ff0cb 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc.LinqService).sql index 4397cc265d3c..5b800c9274c4 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc.LinqService).sql index bdf46a439d59..53c81bde61cf 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc.LinqService).sql index 6f002b63ffe9..e0296c929054 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc.LinqService).sql index 6f002b63ffe9..e0296c929054 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc.LinqService).sql index 6d6a4e3050cd..63cd915ff0cb 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc.LinqService).sql index 6d6a4e3050cd..63cd915ff0cb 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc.LinqService).sql index 4cb525232590..a15a149d2e4f 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc.LinqService).sql index b55c64fc9801..4a6118a80659 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc.LinqService).sql index b55c64fc9801..4a6118a80659 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc.LinqService).sql index 8b61921a93ba..eef5e43bcf8c 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc.LinqService).sql index 8b61921a93ba..eef5e43bcf8c 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc.LinqService).sql index 9daecb66ac28..3292e734a4f5 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.Odbc.LinqService).sql new file mode 100644 index 000000000000..e8ecf0ac5f80 --- /dev/null +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.Odbc.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Ace.Odbc AccessODBC (asynchronously) + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.Odbc AccessODBC (asynchronously) + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.Odbc AccessODBC (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.Odbc AccessODBC (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc.LinqService).sql index d3198c29dd63..f4221525f555 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc.LinqService).sql @@ -31,13 +31,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Ace.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc.LinqService).sql index 5365fbc126c7..6dc9a72c5003 100644 --- a/Access.Ace.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Ace.Odbc AccessODBC (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Ace.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Ace.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index fd02dc85951b..2dff4470ba87 100644 --- a/Access.Ace.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Ace.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE ? AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE ? AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- Access.Ace.Odbc AccessODBC (asynchronously) diff --git a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc.LinqService).sql index e2fbdfa70866..f72888692f6a 100644 --- a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc.LinqService).sql index 0b6f69c8b004..f927265a8944 100644 --- a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc.LinqService).sql index cdd2f368da17..24fdccd5ae10 100644 --- a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc.LinqService).sql index d2e8fe66abb4..6721e55c672f 100644 --- a/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc.LinqService).sql index 765c02610e11..84481c303bce 100644 --- a/Access.Ace.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc.LinqService).sql index 9bdb765f1741..9ed4f8553e3d 100644 --- a/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc.LinqService).sql b/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc.LinqService).sql index 9bdb765f1741..9ed4f8553e3d 100644 --- a/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc.LinqService).sql +++ b/Access.Ace.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Ace.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.Odbc).sql new file mode 100644 index 000000000000..54fc69bf7778 --- /dev/null +++ b/Access.Ace.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.Odbc).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Ace.Odbc AccessODBC + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Ace.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.Odbc).sql new file mode 100644 index 000000000000..4562eb0ea888 --- /dev/null +++ b/Access.Ace.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.Odbc).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Ace.Odbc AccessODBC + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Ace.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc).sql index 7c2f90760e54..6f8600b8125e 100644 --- a/Access.Ace.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.Odbc).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Ace.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc).sql index 0179898a8764..9d8db5fb6441 100644 --- a/Access.Ace.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.Odbc).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Ace.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc).sql index 395bd14a1776..39fb001ab742 100644 --- a/Access.Ace.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.Odbc).sql @@ -2,7 +2,7 @@ -- Access.Ace.Odbc AccessODBC SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc).sql index 1ac3d5cd003f..c907dac1482a 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.Odbc).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc).sql index bdf44b42ff3c..970e38500e8f 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.Odbc).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc).sql index 050efdd86535..c869b1348d98 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.Odbc).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc).sql index 33d7e364c5ad..7582c13b3df5 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.Odbc).sql @@ -2,16 +2,16 @@ -- Access.Ace.Odbc AccessODBC SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc).sql index 33d7e364c5ad..7582c13b3df5 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.Odbc).sql @@ -2,16 +2,16 @@ -- Access.Ace.Odbc AccessODBC SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc).sql index 49aa1c2498f0..2ed51e9c22d8 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc).sql index 6c37fd9f2f0d..34accb8829eb 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc).sql index 8d687b6517fa..1a3af41a0923 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc).sql index 69b4b2cc50b3..32bcaf5b0e1e 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.Odbc).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc).sql index 69b4b2cc50b3..32bcaf5b0e1e 100644 --- a/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.Odbc).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc).sql index 9c6275d0a181..9ffb73b99a5c 100644 --- a/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.Odbc).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc).sql index 037c55a8d4ab..ebcdf6367521 100644 --- a/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.Odbc).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc).sql index 875af27d3b81..996b80864906 100644 --- a/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.Odbc).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc).sql index 6acfd6ef7fa4..efdca730ee39 100644 --- a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.Odbc).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc).sql index 91021a7a10b6..0377658c888a 100644 --- a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.Odbc).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc).sql index 5ba05b2e9363..8a48388620f0 100644 --- a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.Odbc).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 2 FROM [Parent] [p] diff --git a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc).sql index 102381215d49..89030e7d46a7 100644 --- a/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.Odbc).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 4 FROM [Parent] [p] diff --git a/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc).sql index 8efc06a5b6ce..33a9bef9cfd5 100644 --- a/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.Odbc).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc).sql index 725cca44b40b..78a700cdc5e2 100644 --- a/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.Odbc).sql @@ -2,17 +2,17 @@ -- Access.Ace.Odbc AccessODBC SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc).sql index 0a67b7491fc0..607b0eb29ea8 100644 --- a/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.Odbc).sql @@ -2,12 +2,12 @@ -- Access.Ace.Odbc AccessODBC SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc).sql index 6f8fe326f64a..77e3f156d031 100644 --- a/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.Odbc).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc).sql index c7a1ad613ab8..0d1486ee5260 100644 --- a/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.Odbc).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc).sql index d1beb78aa38c..71b5cc383c43 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc).sql index 0cc50fa6b64f..e19a47bfc18f 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.Odbc).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc).sql index 9a38e051930f..d7072c521265 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,1).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,1).sql index 998c86f9bf7f..e779441e321c 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,1).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,2).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,2).sql index 998c86f9bf7f..e779441e321c 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,2).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,1).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,1).sql index 0cc50fa6b64f..e19a47bfc18f 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,1).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,2).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,2).sql index 0cc50fa6b64f..e19a47bfc18f 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,2).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.Odbc,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc).sql index d1beb78aa38c..71b5cc383c43 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc).sql index 0cc50fa6b64f..e19a47bfc18f 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.Odbc).sql @@ -2,12 +2,11 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc).sql index 9a38e051930f..d7072c521265 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc).sql index 72b22c34dd7c..a81d083a6299 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc).sql index 72b22c34dd7c..a81d083a6299 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc).sql index d1beb78aa38c..71b5cc383c43 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc).sql index d1beb78aa38c..71b5cc383c43 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc).sql index 2fbdaea98647..8b732f8f347d 100644 --- a/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Ace.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc).sql index 8fd83e0eb0ad..eae073b40288 100644 --- a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc).sql index 8fd83e0eb0ad..eae073b40288 100644 --- a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc).sql index 9b730a539f03..cd6198225bac 100644 --- a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc).sql index 9b730a539f03..cd6198225bac 100644 --- a/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.Odbc AccessODBC @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc).sql index 02775e224c96..c0e278ac932c 100644 --- a/Access.Ace.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.Odbc).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Ace.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.Odbc).sql new file mode 100644 index 000000000000..8a01dccdb479 --- /dev/null +++ b/Access.Ace.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.Odbc).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Ace.Odbc AccessODBC + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.Odbc AccessODBC + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.Odbc AccessODBC + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.Odbc AccessODBC + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Ace.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc).sql index 563ef349191f..743c0de2c97c 100644 --- a/Access.Ace.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.Odbc).sql @@ -35,13 +35,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Ace.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc).sql index e22f72d3e9ac..f2327f05db12 100644 --- a/Access.Ace.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.Odbc).sql @@ -2,12 +2,12 @@ -- Access.Ace.Odbc AccessODBC SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Ace.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Ace.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 304ad07010e4..f08cd690b7f2 100644 --- a/Access.Ace.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Ace.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE ? AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE ? AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc).sql index 29869e816568..a2a0906ec68c 100644 --- a/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.Odbc).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc).sql index e1e8b6a0d059..8aece6e3b916 100644 --- a/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.Odbc).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.Odbc).sql index 7ab8873ffd29..abc9a64326d9 100644 --- a/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.Odbc).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.Odbc).sql index 7ab8873ffd29..abc9a64326d9 100644 --- a/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.Odbc).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc).sql index 46c26060c48b..0cb7422ba46e 100644 --- a/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.Odbc).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc).sql index 6da29be1a6b7..e06c2bb0df45 100644 --- a/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.Odbc).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc).sql index 01671d7f0393..968eeaa159e0 100644 --- a/Access.Ace.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.Odbc).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc).sql index da0270405577..3e17e00b0b42 100644 --- a/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.Odbc).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc).sql b/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc).sql index da0270405577..3e17e00b0b42 100644 --- a/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc).sql +++ b/Access.Ace.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.Odbc).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Ace.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.OleDb.LinqService).sql new file mode 100644 index 000000000000..1c1431465481 --- /dev/null +++ b/Access.Ace.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.OleDb.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Ace.OleDb AccessOleDb (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Ace.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.OleDb.LinqService).sql new file mode 100644 index 000000000000..1c9afb5f566c --- /dev/null +++ b/Access.Ace.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.OleDb.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Ace.OleDb AccessOleDb (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Ace.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb.LinqService).sql index f27e265c80ea..ae44d5ad40a6 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb.LinqService).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb.LinqService).sql index aed707fe2c5a..daeeb4d7c39f 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb.LinqService).sql index 8daf899b38c7..de18909387c4 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb.LinqService).sql @@ -2,7 +2,7 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb.LinqService).sql index 654b4994dc61..e524d35db4d7 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb.LinqService).sql index 15f11920f9d5..bebd94681f84 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb.LinqService).sql index 2bcfd6ed6509..48b90763535c 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb.LinqService).sql index 8c5197f34759..6f6f8308135a 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb.LinqService).sql index 8c5197f34759..6f6f8308135a 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb.LinqService).sql index 95b2289bec7d..86741fef90ca 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb.LinqService).sql index 6404e6f71577..ecd84bfccf23 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb.LinqService).sql index 494ce27f9fe5..b4294b80025e 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb.LinqService).sql index e74d84e6b44d..96bdbb2f9d71 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb.LinqService).sql index e74d84e6b44d..96bdbb2f9d71 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb.LinqService).sql index 41ad12acbfec..cfbabd405601 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb.LinqService).sql index 7f941f5779c5..11656eafe15f 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb.LinqService).sql index bb4811e0909d..c783ab39cd7c 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb.LinqService).sql index 5ccb25e25fa2..a150ce796fd6 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb.LinqService).sql index 580259091303..74c89118d0c4 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb.LinqService).sql index 213b8bff675d..3efd5f7b4f96 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb.LinqService).sql index 240be702fbef..724924bba7e1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb.LinqService).sql index be60374646c8..c3e022bf1e7e 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb.LinqService).sql index b20e93ad7333..39ca9f191176 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb.LinqService).sql @@ -2,17 +2,17 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb.LinqService).sql index 3695d868f220..1fa398163eaa 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb.LinqService).sql index d52c0f18a53d..4c5ba226cce1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb.LinqService).sql index 3cf621236a09..4fd039cbacc7 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb.LinqService).sql index 8301c8f282e0..9e3a553c1361 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb.LinqService).sql index fa5cef8e64aa..c80eeff3c7a1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb.LinqService).sql index 8645ca21726e..50023d46ead6 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,1).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,1).sql index ae518f752e1f..1b6b59144997 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,1).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,2).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,2).sql index ae518f752e1f..1b6b59144997 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,2).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,1).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,1).sql index fa5cef8e64aa..c80eeff3c7a1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,1).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,2).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,2).sql index fa5cef8e64aa..c80eeff3c7a1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,2).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb.LinqService).sql index 8301c8f282e0..9e3a553c1361 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb.LinqService).sql index fa5cef8e64aa..c80eeff3c7a1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb.LinqService).sql index 8645ca21726e..50023d46ead6 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb.LinqService).sql index 8c999c5870d2..c5d703f156f1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb.LinqService).sql index 8c999c5870d2..c5d703f156f1 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb.LinqService).sql index 8301c8f282e0..9e3a553c1361 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb.LinqService).sql index 8301c8f282e0..9e3a553c1361 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb.LinqService).sql index af27250194b4..11397bb893bf 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb.LinqService).sql index ec5ca911aec1..3ccc6a40b5a2 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb.LinqService).sql index ec5ca911aec1..3ccc6a40b5a2 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb.LinqService).sql index 3b2aae24538e..25edcc7836d9 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb.LinqService).sql index 3b2aae24538e..25edcc7836d9 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb.LinqService).sql index 6586e1a85294..1f39351077ec 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.OleDb.LinqService).sql new file mode 100644 index 000000000000..28cd97a6ffa3 --- /dev/null +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.OleDb.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Ace.OleDb AccessOleDb (asynchronously) + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.OleDb AccessOleDb (asynchronously) + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.OleDb AccessOleDb (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.OleDb AccessOleDb (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb.LinqService).sql index a1bd62338ff0..39ff6535030d 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb.LinqService).sql @@ -31,13 +31,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Ace.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb.LinqService).sql index b60b4576463e..369cfdae0e19 100644 --- a/Access.Ace.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Ace.OleDb AccessOleDb (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Ace.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Ace.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 1f58a2ef8a92..1745bb109da3 100644 --- a/Access.Ace.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Ace.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- Access.Ace.OleDb AccessOleDb (asynchronously) diff --git a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb.LinqService).sql index b2a7e44dcbe8..33d4cbcf7e90 100644 --- a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb.LinqService).sql index 6a8f05b6a825..d49347da892c 100644 --- a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb.LinqService).sql index 810fdb36c286..306971775f59 100644 --- a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb.LinqService).sql index 1ab3108c6e6f..c1c356146274 100644 --- a/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb.LinqService).sql index af965e0b8d6c..78509a74ff68 100644 --- a/Access.Ace.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb.LinqService).sql index 799482457d8c..efea52673643 100644 --- a/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb.LinqService).sql b/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb.LinqService).sql index 799482457d8c..efea52673643 100644 --- a/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb.LinqService).sql +++ b/Access.Ace.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Ace.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.OleDb).sql new file mode 100644 index 000000000000..453a1318faa4 --- /dev/null +++ b/Access.Ace.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Ace.OleDb).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Ace.OleDb AccessOleDb + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Ace.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.OleDb).sql new file mode 100644 index 000000000000..19f3385e8f46 --- /dev/null +++ b/Access.Ace.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Ace.OleDb).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Ace.OleDb AccessOleDb + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Ace.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb).sql index 65513801cffa..47598e16e1b8 100644 --- a/Access.Ace.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Ace.OleDb).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Ace.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb).sql index aff47fd8bb1a..ad68e8612ff6 100644 --- a/Access.Ace.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Ace.OleDb).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Ace.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb).sql index b060271355a9..8c67276e1dd0 100644 --- a/Access.Ace.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Ace.OleDb).sql @@ -2,7 +2,7 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb).sql index af2ef5f29fd6..212ef5d4ea61 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Ace.OleDb).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb).sql index 0bb89a88e218..a1f2e011cf46 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Ace.OleDb).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb).sql index 3e8b152d12ba..0d3935432152 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Ace.OleDb).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb).sql index 3f39dc661f69..adaba7f83020 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Ace.OleDb).sql @@ -2,16 +2,16 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb).sql index 3f39dc661f69..adaba7f83020 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Ace.OleDb).sql @@ -2,16 +2,16 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb).sql index 0b613242eac6..2705daaf62e3 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Ace.OleDb).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb).sql index f3dcd987a642..58e41a5ac430 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Ace.OleDb).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb).sql index 15481a895a73..0a7a6987c4e3 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Ace.OleDb).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb).sql index 4e92bd3bfbc0..4afbd21bf129 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Ace.OleDb).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb).sql index 4e92bd3bfbc0..4afbd21bf129 100644 --- a/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Ace.OleDb).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb).sql index ac005845604a..e2b0c836f0c2 100644 --- a/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Ace.OleDb).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb).sql index f55b2c62f155..f8cdc111b11c 100644 --- a/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Ace.OleDb).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb).sql index cc1dfc392cd1..874e81a775aa 100644 --- a/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Ace.OleDb).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb).sql index 20a589011534..49497e32beb4 100644 --- a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Ace.OleDb).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb).sql index b2db81a9d196..b0d62c70b32a 100644 --- a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Ace.OleDb).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb).sql index 1cad64d7f1d6..a4544e6c9fc9 100644 --- a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Ace.OleDb).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb).sql index 81326eb78c03..902058183431 100644 --- a/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Ace.OleDb).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb).sql index 447958608af1..e5a8120d9f63 100644 --- a/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Ace.OleDb).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb).sql index 101394e53791..8b040766f6ac 100644 --- a/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Ace.OleDb).sql @@ -2,17 +2,17 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb).sql index 7c00de034ea4..02b325cf3e37 100644 --- a/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Ace.OleDb).sql @@ -2,12 +2,12 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb).sql index 74c28d9818dc..7a243f5314c0 100644 --- a/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Ace.OleDb).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb).sql index cc6425ee994c..7d9a80a60a25 100644 --- a/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Ace.OleDb).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb).sql index b541a4aa7ced..c3b8c3c49ba6 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb).sql index bd69bde0fb7d..a3c9dba4ddc2 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Ace.OleDb).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb).sql index e36ec274a53c..529e394af7a4 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,1).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,1).sql index af09ce261bad..44a626ddf2e7 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,1).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,2).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,2).sql index af09ce261bad..44a626ddf2e7 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,2).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,1).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,1).sql index bd69bde0fb7d..a3c9dba4ddc2 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,1).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,2).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,2).sql index bd69bde0fb7d..a3c9dba4ddc2 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,2).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Ace.OleDb,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb).sql index b541a4aa7ced..c3b8c3c49ba6 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb).sql index bd69bde0fb7d..a3c9dba4ddc2 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Ace.OleDb).sql @@ -2,12 +2,11 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb).sql index e36ec274a53c..529e394af7a4 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb).sql index 08b962babb8a..ab97a23b32ee 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb).sql index 08b962babb8a..ab97a23b32ee 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb).sql index b541a4aa7ced..c3b8c3c49ba6 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb).sql index b541a4aa7ced..c3b8c3c49ba6 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb).sql index 67366cbfad86..7349c5ce2f8a 100644 --- a/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Ace.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb).sql index c8715d934b7c..1cc5e0a88fe2 100644 --- a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Ace.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb).sql index c8715d934b7c..1cc5e0a88fe2 100644 --- a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Ace.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb).sql index f9e9eab5883a..3cccd64593a3 100644 --- a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Ace.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb).sql index f9e9eab5883a..3cccd64593a3 100644 --- a/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Ace.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Ace.OleDb AccessOleDb @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Ace.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb).sql index 3ee080e030c1..0c3201453f07 100644 --- a/Access.Ace.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Ace.OleDb).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Ace.OleDb/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.OleDb).sql new file mode 100644 index 000000000000..b15ddc5041a3 --- /dev/null +++ b/Access.Ace.OleDb/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Ace.OleDb).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Ace.OleDb AccessOleDb + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.OleDb AccessOleDb + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.OleDb AccessOleDb + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Ace.OleDb AccessOleDb + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Ace.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb).sql index b88f86a135d3..3287f0d8df89 100644 --- a/Access.Ace.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Ace.OleDb).sql @@ -35,13 +35,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Ace.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb).sql index 07fe1dc81d8b..39e2263b1f27 100644 --- a/Access.Ace.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Ace.OleDb).sql @@ -2,12 +2,12 @@ -- Access.Ace.OleDb AccessOleDb SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Ace.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Ace.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index d2b16cfa3dbc..660d4126ddef 100644 --- a/Access.Ace.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Ace.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Ace.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb).sql index fae18fd16cc1..5e6f48dbae24 100644 --- a/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Ace.OleDb).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb).sql index ae30ddc25f91..870df62b5b9a 100644 --- a/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Ace.OleDb).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.OleDb).sql index f649dc558f4f..a72320a06760 100644 --- a/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Ace.OleDb).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.OleDb).sql index f649dc558f4f..a72320a06760 100644 --- a/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Ace.OleDb).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb).sql index 5e1f1fa96aec..c4baaace45eb 100644 --- a/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Ace.OleDb).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb).sql index 0774175a0cf0..2d1dce09f442 100644 --- a/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Ace.OleDb).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Ace.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb).sql index 7e7d11d00c03..49f946c55502 100644 --- a/Access.Ace.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Ace.OleDb).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb).sql index ffbe029dadd8..34fec5edce49 100644 --- a/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Ace.OleDb).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb).sql b/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb).sql index ffbe029dadd8..34fec5edce49 100644 --- a/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb).sql +++ b/Access.Ace.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Ace.OleDb).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.Odbc.LinqService).sql new file mode 100644 index 000000000000..2885b5fee85d --- /dev/null +++ b/Access.Jet.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.Odbc.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Jet.Odbc AccessODBC (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Jet.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.Odbc.LinqService).sql new file mode 100644 index 000000000000..d59077fe4110 --- /dev/null +++ b/Access.Jet.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.Odbc.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Jet.Odbc AccessODBC (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Jet.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc.LinqService).sql index 6ea34a652058..8b6e6c541a2b 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc.LinqService).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc.LinqService).sql index f2a96f47a916..151254f414b3 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc.LinqService).sql index e01ac6d678e2..47f7290c8260 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc.LinqService).sql index 4e3e165c344d..b0e590cf7069 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc.LinqService).sql index 7219bfd50caf..5e4674e1d6c1 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc.LinqService).sql index efdb5a75fdf2..a2efbfd43b9f 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc.LinqService).sql index 22ba12b1f0a9..ddc48eab691b 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc.LinqService).sql index 22ba12b1f0a9..ddc48eab691b 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc.LinqService).sql index 85119a5bbf8e..157d9c1ce2d5 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc.LinqService).sql index c06d0c904d8d..4d27cb2dc4f5 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc.LinqService).sql index d2c889d4b905..cc1be1f67acf 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc.LinqService).sql index 345c4767f36e..c443fd2f3aeb 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc.LinqService).sql index 345c4767f36e..c443fd2f3aeb 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc.LinqService).sql index b4093ef05f05..6c981c4bbb2a 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc.LinqService).sql index 1949d3c8fc10..c8921ec37388 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc.LinqService).sql index 1c2b3451ec89..9ed5cf57f2fe 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc.LinqService).sql index 1af05b41f4a5..74f16a07baee 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc.LinqService).sql index 5af11d23bc69..a81677fd32da 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc.LinqService).sql index b17e23ec0a6c..2488a6316c8f 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 2 FROM [Parent] [p] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc.LinqService).sql index 696fe0a1467c..ca6bfbae3d73 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 4 FROM [Parent] [p] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc.LinqService).sql index 33487ef83863..e5425cee0e16 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc.LinqService).sql index 9071d75451c1..10c484e76d04 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc.LinqService).sql @@ -2,17 +2,17 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc.LinqService).sql index 075738083d44..9ee57b7ed868 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc.LinqService).sql index c838373919be..5f094d8cf364 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc.LinqService).sql index fd980da65a8b..a6c5764167bb 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc.LinqService).sql index e8868cfcb40b..ae1fb72dd6c0 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc.LinqService).sql index 9946f8095e09..b8918c4fe922 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc.LinqService).sql index 05967bf7ac10..bddd12bc99b3 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,1).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,1).sql index 61a856ee2032..ddc6f8c493a0 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,1).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,2).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,2).sql index 61a856ee2032..ddc6f8c493a0 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,2).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,1).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,1).sql index 9946f8095e09..b8918c4fe922 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,1).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,2).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,2).sql index 9946f8095e09..b8918c4fe922 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,2).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc.LinqService).sql index e8868cfcb40b..ae1fb72dd6c0 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc.LinqService).sql index 9946f8095e09..b8918c4fe922 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc.LinqService).sql index 05967bf7ac10..bddd12bc99b3 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc.LinqService).sql index 5f417417032a..360ef497b7d9 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc.LinqService).sql index 5f417417032a..360ef497b7d9 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc.LinqService).sql index e8868cfcb40b..ae1fb72dd6c0 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc.LinqService).sql index e8868cfcb40b..ae1fb72dd6c0 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc.LinqService).sql index 39ee2c2c6eaf..9c9dbdda7504 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc.LinqService).sql index 3e42195f1963..3737d01bdb98 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc.LinqService).sql index 3e42195f1963..3737d01bdb98 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc.LinqService).sql index b95404846bd5..b605e1ab15fc 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc.LinqService).sql index b95404846bd5..b605e1ab15fc 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc.LinqService).sql index 450303d8998a..98e723c07ee0 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.Odbc.LinqService).sql new file mode 100644 index 000000000000..89162c3daf3c --- /dev/null +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.Odbc.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Jet.Odbc AccessODBC (asynchronously) + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.Odbc AccessODBC (asynchronously) + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.Odbc AccessODBC (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.Odbc AccessODBC (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc.LinqService).sql index da777393129d..8f780774f75d 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc.LinqService).sql @@ -31,13 +31,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Jet.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc.LinqService).sql index 2f6471d8cbae..3b9b7a035d25 100644 --- a/Access.Jet.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Jet.Odbc AccessODBC (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Jet.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Jet.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 6069a667c996..1a0f72488614 100644 --- a/Access.Jet.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Jet.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE ? AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE ? AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- Access.Jet.Odbc AccessODBC (asynchronously) diff --git a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc.LinqService).sql index 6c86e381e29b..cf41f2789dcf 100644 --- a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc.LinqService).sql index ec7098576596..34a6f9d43b24 100644 --- a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc.LinqService).sql index 6f59ae60a706..6ed51cdd6177 100644 --- a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc.LinqService).sql index 20b9d01f915d..1b3038dee15a 100644 --- a/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc.LinqService).sql index d601914bc34d..1d87c8cf8869 100644 --- a/Access.Jet.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc.LinqService).sql index 310efcd47f6f..6506479af9fd 100644 --- a/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc.LinqService).sql b/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc.LinqService).sql index 310efcd47f6f..6506479af9fd 100644 --- a/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc.LinqService).sql +++ b/Access.Jet.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.Odbc).sql new file mode 100644 index 000000000000..cf6dbadc4bf9 --- /dev/null +++ b/Access.Jet.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.Odbc).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Jet.Odbc AccessODBC + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Jet.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.Odbc).sql new file mode 100644 index 000000000000..9c401e0882e0 --- /dev/null +++ b/Access.Jet.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.Odbc).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Jet.Odbc AccessODBC + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Jet.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc).sql index 8ac7d1f8cb75..2c3f3375cec9 100644 --- a/Access.Jet.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.Odbc).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Jet.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc).sql index ea4e9643c6a7..d2128c65b787 100644 --- a/Access.Jet.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.Odbc).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Jet.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc).sql index 1a606677953b..b98b5516813f 100644 --- a/Access.Jet.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.Odbc).sql @@ -2,7 +2,7 @@ -- Access.Jet.Odbc AccessODBC SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc).sql index 363f2fbb01a0..bb21eeaa6e64 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.Odbc).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc).sql index 4a766778156b..7bfd6d50a3d6 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.Odbc).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc).sql index 28bd5a3aa015..5b32bcb2f34c 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.Odbc).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc).sql index f7317fafe5a0..6d015c3da1ca 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.Odbc).sql @@ -2,16 +2,16 @@ -- Access.Jet.Odbc AccessODBC SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc).sql index f7317fafe5a0..6d015c3da1ca 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.Odbc).sql @@ -2,16 +2,16 @@ -- Access.Jet.Odbc AccessODBC SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc).sql index f396cdd71fb9..a4007a50e229 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc).sql index 76417774c061..b01457046c98 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc).sql index 9d04bd1b1b58..fc1f29453f40 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc).sql index c54148cf2f34..4a24d5d06a2f 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.Odbc).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc).sql index c54148cf2f34..4a24d5d06a2f 100644 --- a/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.Odbc).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc).sql index 4ad60e72b61e..22a6c75c9ba3 100644 --- a/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.Odbc).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc).sql index 3bcac6e22d46..6f3421ef035c 100644 --- a/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.Odbc).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc).sql index 851cfca9f4c6..8a6c19818e65 100644 --- a/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.Odbc).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc).sql index 467d7521e8c1..f517861ff547 100644 --- a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.Odbc).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc).sql index f1e3a5e76b00..6333832384bd 100644 --- a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.Odbc).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc).sql index afbbe0b31dd7..4fa3042ae73c 100644 --- a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.Odbc).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 2 FROM [Parent] [p] diff --git a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc).sql index 4cbf7fb41310..db1246af90a7 100644 --- a/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.Odbc).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > ? + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > ? ) + 4 FROM [Parent] [p] diff --git a/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc).sql index e37486a6a569..9b557f699ae4 100644 --- a/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.Odbc).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc).sql index 213eaaa9d54f..aba98e7cbe54 100644 --- a/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.Odbc).sql @@ -2,17 +2,17 @@ -- Access.Jet.Odbc AccessODBC SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc).sql index 61f3a3b806f5..16f8cc4843b6 100644 --- a/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.Odbc).sql @@ -2,12 +2,12 @@ -- Access.Jet.Odbc AccessODBC SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc).sql index 8a1589ed10e4..8d655bc1ec10 100644 --- a/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.Odbc).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc).sql index 05f9ff6833ec..21770cfac31d 100644 --- a/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.Odbc).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc).sql index efbe9dc1edbd..291edf2006e2 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc).sql index 05c28e7376fd..ea547dbdf224 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.Odbc).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc).sql index 7d6e54f3da9b..455d61d9fb22 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,1).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,1).sql index f420681bede0..697969750f31 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,1).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,2).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,2).sql index f420681bede0..697969750f31 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,2).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,1).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,1).sql index 05c28e7376fd..ea547dbdf224 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,1).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,2).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,2).sql index 05c28e7376fd..ea547dbdf224 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,2).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.Odbc,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc).sql index efbe9dc1edbd..291edf2006e2 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc).sql index 05c28e7376fd..ea547dbdf224 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.Odbc).sql @@ -2,12 +2,11 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc).sql index 7d6e54f3da9b..455d61d9fb22 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc).sql index e4cf22d90101..e7cd3658d3e7 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc).sql index e4cf22d90101..e7cd3658d3e7 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc).sql index efbe9dc1edbd..291edf2006e2 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc).sql index efbe9dc1edbd..291edf2006e2 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc).sql index 42d211ce77c9..a25212c1fce4 100644 --- a/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.Odbc).sql @@ -2,9 +2,14 @@ -- Access.Jet.Odbc AccessODBC SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc).sql index 5cc15ab9feb5..368b5ff4c8ae 100644 --- a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc).sql index 5cc15ab9feb5..368b5ff4c8ae 100644 --- a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc).sql index 7fc610b4bffb..c2fd0f34ff1c 100644 --- a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc).sql index 7fc610b4bffb..c2fd0f34ff1c 100644 --- a/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.Odbc AccessODBC @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc).sql index c9536d4db473..859101d85de1 100644 --- a/Access.Jet.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.Odbc).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Jet.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.Odbc).sql new file mode 100644 index 000000000000..d06968f5b3d1 --- /dev/null +++ b/Access.Jet.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.Odbc).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Jet.Odbc AccessODBC + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.Odbc AccessODBC + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.Odbc AccessODBC + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.Odbc AccessODBC + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Jet.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc).sql index 9966415d48b9..b9a1a56eb5a9 100644 --- a/Access.Jet.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.Odbc).sql @@ -35,13 +35,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Jet.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc).sql index 30f2bc6708dc..91f520b4f299 100644 --- a/Access.Jet.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.Odbc).sql @@ -2,12 +2,12 @@ -- Access.Jet.Odbc AccessODBC SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Jet.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Jet.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 75acfe1c45d0..39fdb91a3b91 100644 --- a/Access.Jet.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Jet.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE ? AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE ? AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc).sql index e7f846283370..7ae025137bcd 100644 --- a/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.Odbc).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc).sql index 3ed6737244f0..5289250b707a 100644 --- a/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.Odbc).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.Odbc).sql index f75622542b9b..b66948044da9 100644 --- a/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.Odbc).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.Odbc).sql index f75622542b9b..b66948044da9 100644 --- a/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.Odbc).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc).sql index 9131777cb34e..01aa9ee6ea30 100644 --- a/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.Odbc).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc).sql index dae26478fc5a..13b24fe4b899 100644 --- a/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.Odbc).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc).sql index 7b1be7d17413..4ae547c64770 100644 --- a/Access.Jet.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.Odbc).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc).sql index ce6c64b8abb8..65286457270b 100644 --- a/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.Odbc).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc).sql b/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc).sql index ce6c64b8abb8..65286457270b 100644 --- a/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc).sql +++ b/Access.Jet.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.Odbc).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.OleDb.LinqService).sql new file mode 100644 index 000000000000..922abefafe85 --- /dev/null +++ b/Access.Jet.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.OleDb.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Jet.OleDb AccessOleDb (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Jet.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.OleDb.LinqService).sql new file mode 100644 index 000000000000..d6b181e0a6ba --- /dev/null +++ b/Access.Jet.OleDb.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.OleDb.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Jet.OleDb AccessOleDb (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Jet.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb.LinqService).sql index 6614530fb833..6e552433ad77 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb.LinqService).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb.LinqService).sql index 86e5d9356952..b7c82b8aa39b 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb.LinqService).sql index 6355b8b584aa..fcf19b6795cb 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb.LinqService).sql @@ -2,7 +2,7 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb.LinqService).sql index e2e40865acda..4da50be17caa 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb.LinqService).sql index da6e7b03caf6..0ba36cf601f3 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb.LinqService).sql index 433b94c3dbfb..38f8a7059638 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb.LinqService).sql index fa04cccd2424..4213a1f90858 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb.LinqService).sql index fa04cccd2424..4213a1f90858 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb.LinqService).sql @@ -2,16 +2,16 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb.LinqService).sql index 237f4ec06a1b..6345e3a423d6 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb.LinqService).sql index ff1bd032479a..1ee18b2b68fa 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb.LinqService).sql index 8faf1002e484..7af18bf96c08 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb.LinqService).sql index 4742e743c26d..082fece81d9d 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb.LinqService).sql index 4742e743c26d..082fece81d9d 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb.LinqService).sql index abb7697082b0..85a8b6ba6ea0 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb.LinqService).sql index 16fe1aec5dec..257a9ffb1052 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb.LinqService).sql index 2ef511336c49..2fbafaf61dfd 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb.LinqService).sql index 444ad83c1cf3..c65a6e5723ce 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb.LinqService).sql index 80491a13fa3b..a7cee04d480a 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb.LinqService).sql index e70df391e958..78083d16e198 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb.LinqService).sql index 07a998cd57cc..03036104ac64 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb.LinqService).sql index 8b9fbc505491..2eb3e4efbee1 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb.LinqService).sql index b3130fc5abd0..f4e2fd07290a 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb.LinqService).sql @@ -2,17 +2,17 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb.LinqService).sql index c9e6dd087ac5..7b6eb1e15ebc 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb.LinqService).sql index 87bbc88cdd6e..8e309ec5a1cb 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb.LinqService).sql index 101fa3d76a50..2a02c97409b6 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb.LinqService).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb.LinqService).sql index f7fa48e377fe..6e1ac92dae32 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb.LinqService).sql index cc9db7cda33a..6013677ebeff 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb.LinqService).sql index 9307ab8fa679..376e83602a15 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,1).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,1).sql index 10224427d47f..6c75487cb1ef 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,1).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,2).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,2).sql index 10224427d47f..6c75487cb1ef 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,2).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,1).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,1).sql index cc9db7cda33a..6013677ebeff 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,1).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,2).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,2).sql index cc9db7cda33a..6013677ebeff 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,2).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb.LinqService).sql index f7fa48e377fe..6e1ac92dae32 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb.LinqService).sql index cc9db7cda33a..6013677ebeff 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb.LinqService).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb.LinqService).sql index 9307ab8fa679..376e83602a15 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb.LinqService).sql index a60a5e181409..105d80a7a0bc 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb.LinqService).sql index a60a5e181409..105d80a7a0bc 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb.LinqService).sql index f7fa48e377fe..6e1ac92dae32 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb.LinqService).sql index f7fa48e377fe..6e1ac92dae32 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb.LinqService).sql index 7d597aba6dfe..1526127a4a12 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb.LinqService).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb.LinqService).sql index d8cfd33b3f92..19dd70493457 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb.LinqService).sql index d8cfd33b3f92..19dd70493457 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb.LinqService).sql index 931ec4dd1341..71a642739690 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb.LinqService).sql index 931ec4dd1341..71a642739690 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb.LinqService).sql index 5ea336d4bf01..4f95f0baa72e 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.OleDb.LinqService).sql new file mode 100644 index 000000000000..019c5647edbd --- /dev/null +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.OleDb.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Jet.OleDb AccessOleDb (asynchronously) + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.OleDb AccessOleDb (asynchronously) + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.OleDb AccessOleDb (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.OleDb AccessOleDb (asynchronously) + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb.LinqService).sql index 57d8788c887d..692f0f06bc1a 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb.LinqService).sql @@ -31,13 +31,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Jet.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb.LinqService).sql index 3a5d1b29f06e..53528ea14dcf 100644 --- a/Access.Jet.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb.LinqService).sql @@ -2,12 +2,12 @@ -- Access.Jet.OleDb AccessOleDb (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Jet.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Jet.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 45b50177198d..31a4460693ac 100644 --- a/Access.Jet.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Jet.OleDb.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- Access.Jet.OleDb AccessOleDb (asynchronously) diff --git a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb.LinqService).sql index 85191d70ec2a..1ab7a6001981 100644 --- a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb.LinqService).sql index 6d55a8e5c165..b2617b400909 100644 --- a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb.LinqService).sql index 48d81e4bcb39..ab5ea4b89b0c 100644 --- a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb.LinqService).sql index bbf869c421db..df20fb038686 100644 --- a/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb.LinqService).sql index b0e8f932fcfa..5fb836412f06 100644 --- a/Access.Jet.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb.LinqService).sql index ccd3848ce98f..d7e85d12296c 100644 --- a/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb.LinqService).sql b/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb.LinqService).sql index ccd3848ce98f..d7e85d12296c 100644 --- a/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb.LinqService).sql +++ b/Access.Jet.OleDb.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.OleDb).sql new file mode 100644 index 000000000000..e515dd523931 --- /dev/null +++ b/Access.Jet.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Access.Jet.OleDb).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Access.Jet.OleDb AccessOleDb + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/Access.Jet.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.OleDb).sql new file mode 100644 index 000000000000..2b5809979ce5 --- /dev/null +++ b/Access.Jet.OleDb/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Access.Jet.OleDb).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Access.Jet.OleDb AccessOleDb + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/Access.Jet.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb).sql index 28fd6c57c5ed..1ed3882e61be 100644 --- a/Access.Jet.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Access.Jet.OleDb).sql @@ -4,12 +4,12 @@ SELECT [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/Access.Jet.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb).sql index 1c912e610c3a..3e1e35adc33c 100644 --- a/Access.Jet.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Access.Jet.OleDb).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/Access.Jet.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb).sql index ce674c87f30e..dc21d30419df 100644 --- a/Access.Jet.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Access.Jet.OleDb).sql @@ -2,7 +2,7 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [p].[ID] + CStr([p].[ID]) FROM [LinqDataTypes] [p] WHERE diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb).sql index 563a04561993..eba18d3c6835 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Access.Jet.OleDb).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb).sql index 43d5bece835e..56fc05f98c9e 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Access.Jet.OleDb).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb).sql index 37aefe6c0a00..12aadbfa4d72 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Access.Jet.OleDb).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON ([p].[ParentID] = [a_Parent].[ParentID]) + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON ([ch].[ParentID] = [a_Parent].[ParentID]) WHERE [a_Parent].[ParentID] = 1 diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb).sql index a22627273f7c..b259981b85b1 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Access.Jet.OleDb).sql @@ -2,16 +2,16 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb).sql index a22627273f7c..b259981b85b1 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Access.Jet.OleDb).sql @@ -2,16 +2,16 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb).sql index abb1b3a0fb54..605687f16912 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Access.Jet.OleDb).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb).sql index dc4175f11986..491d7ccb61a1 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Access.Jet.OleDb).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb).sql index 5bd1dba30b7a..5a13ffedd6b9 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Access.Jet.OleDb).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb).sql index acec48e46163..c6886fe9ca7d 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Access.Jet.OleDb).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb).sql index acec48e46163..c6886fe9ca7d 100644 --- a/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Access.Jet.OleDb).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb).sql index cc6c822f7689..7d6cd35b236b 100644 --- a/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(Access.Jet.OleDb).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb).sql index 7aae54e332d1..80813bbf7e34 100644 --- a/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(Access.Jet.OleDb).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb).sql index a4fcb046dde6..c87214b2e3d0 100644 --- a/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(Access.Jet.OleDb).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - IIF([x_1].[SUM_1] IS NULL, 0, [x_1].[SUM_1]) + IIF([x_1].[Sum_1] IS NULL, 0, [x_1].[Sum_1]) diff --git a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb).sql index b3b7593dcf02..2eac4636ad2d 100644 --- a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Access.Jet.OleDb).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb).sql index e4e37d527293..7f719d846bcf 100644 --- a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Access.Jet.OleDb).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb).sql index 9f7173ee10d6..f5c71c8cd8a4 100644 --- a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Access.Jet.OleDb).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb).sql index b70c057b81a5..6f182106e961 100644 --- a/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Access.Jet.OleDb).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb).sql index 11eda77af39a..e4223cc72b00 100644 --- a/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Access.Jet.OleDb).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb).sql index fdb31e9fd08d..1a284bb65dca 100644 --- a/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Access.Jet.OleDb).sql @@ -2,17 +2,17 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb).sql index 9ab62181ff6c..4bf62bc650a7 100644 --- a/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Access.Jet.OleDb).sql @@ -2,12 +2,12 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb).sql index bda5ad4c38b2..3373f654fe10 100644 --- a/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Access.Jet.OleDb).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertKey], [al_group_3].[AlertCode], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertKey], [al_group_4].[AlertCode], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertKey], [al_group_5].[AlertCode], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertKey], [al_group_6].[AlertCode], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertKey], [al_group_7].[AlertCode], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertKey], [al_group_8].[AlertCode], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertKey], [al_group_9].[AlertCode], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb).sql index f09a16032652..ca9d1cdae3f5 100644 --- a/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Access.Jet.OleDb).sql @@ -54,14 +54,14 @@ SELECT [al_group_2].[AlertCode], ( SELECT TOP 1 - IIF([t1].[MAX_1] IS NULL, [t1].[CreationDate], [t1].[MAX_1]) + [t1].[LastUpdate] FROM (( SELECT [al_group_3].[AlertCode], [al_group_3].[AlertKey], [al_group_3].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + IIF(MAX([au_1].[TransactionDate]) IS NULL, [al_group_3].[CreationDate], MAX([au_1].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_3] LEFT JOIN [AuditAlert] [au_1] ON ([au_1].[AlertKey] = [al_group_3].[AlertKey]) @@ -87,7 +87,7 @@ SELECT [al_group_4].[AlertCode], [al_group_4].[AlertKey], [al_group_4].[CreationDate], - MAX([au_2].[TransactionDate]) as [MAX_1] + IIF(MAX([au_2].[TransactionDate]) IS NULL, [al_group_4].[CreationDate], MAX([au_2].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_4] LEFT JOIN [AuditAlert] [au_2] ON ([au_2].[AlertKey] = [al_group_4].[AlertKey]) @@ -113,7 +113,7 @@ SELECT [al_group_5].[AlertCode], [al_group_5].[AlertKey], [al_group_5].[CreationDate], - MAX([au_3].[TransactionDate]) as [MAX_1] + IIF(MAX([au_3].[TransactionDate]) IS NULL, [al_group_5].[CreationDate], MAX([au_3].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_5] LEFT JOIN [AuditAlert] [au_3] ON ([au_3].[AlertKey] = [al_group_5].[AlertKey]) @@ -139,7 +139,7 @@ SELECT [al_group_6].[AlertCode], [al_group_6].[AlertKey], [al_group_6].[CreationDate], - MAX([au_4].[TransactionDate]) as [MAX_1] + IIF(MAX([au_4].[TransactionDate]) IS NULL, [al_group_6].[CreationDate], MAX([au_4].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_6] LEFT JOIN [AuditAlert] [au_4] ON ([au_4].[AlertKey] = [al_group_6].[AlertKey]) @@ -165,7 +165,7 @@ SELECT [al_group_7].[AlertCode], [al_group_7].[AlertKey], [al_group_7].[CreationDate], - MAX([au_5].[TransactionDate]) as [MAX_1] + IIF(MAX([au_5].[TransactionDate]) IS NULL, [al_group_7].[CreationDate], MAX([au_5].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_7] LEFT JOIN [AuditAlert] [au_5] ON ([au_5].[AlertKey] = [al_group_7].[AlertKey]) @@ -191,7 +191,7 @@ SELECT [al_group_8].[AlertCode], [al_group_8].[AlertKey], [al_group_8].[CreationDate], - MAX([au_6].[TransactionDate]) as [MAX_1] + IIF(MAX([au_6].[TransactionDate]) IS NULL, [al_group_8].[CreationDate], MAX([au_6].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_8] LEFT JOIN [AuditAlert] [au_6] ON ([au_6].[AlertKey] = [al_group_8].[AlertKey]) @@ -217,7 +217,7 @@ SELECT [al_group_9].[AlertCode], [al_group_9].[AlertKey], [al_group_9].[CreationDate], - MAX([au_7].[TransactionDate]) as [MAX_1] + IIF(MAX([au_7].[TransactionDate]) IS NULL, [al_group_9].[CreationDate], MAX([au_7].[TransactionDate])) as [LastUpdate] FROM [Alert] [al_group_9] LEFT JOIN [AuditAlert] [au_7] ON ([au_7].[AlertKey] = [al_group_9].[AlertKey]) diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb).sql index 05146d7b09b8..1e163263aabe 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb).sql index 29e00a00efc0..caf6b4ce3d5f 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Access.Jet.OleDb).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb).sql index f749836a9cbd..ce377a1d86f8 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,1).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,1).sql index 4f3fe5ace05e..fc8c6b396cb5 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,1).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,2).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,2).sql index 4f3fe5ace05e..fc8c6b396cb5 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,2).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,1).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,1).sql index 29e00a00efc0..caf6b4ce3d5f 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,1).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,1).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,2).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,2).sql index 29e00a00efc0..caf6b4ce3d5f 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,2).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Access.Jet.OleDb,ToEven,2).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb).sql index 05146d7b09b8..1e163263aabe 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb).sql index 29e00a00efc0..caf6b4ce3d5f 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Access.Jet.OleDb).sql @@ -2,12 +2,11 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb).sql index f749836a9cbd..ce377a1d86f8 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] * 2 = ROUND([t].[MoneyValue] * 2, 1) AND [t].[MoneyValue] <> ROUND([t].[MoneyValue], 1), ROUND([t].[MoneyValue] / 2, 1) * 2, ROUND([t].[MoneyValue], 1)) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb).sql index 4b2ec67cccb7..6a95198d9cee 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb).sql index 4b2ec67cccb7..6a95198d9cee 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] >= 0, Int([p].[MoneyValue] + 0.5), Int([p].[MoneyValue] - 0.5)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb).sql index 05146d7b09b8..1e163263aabe 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb).sql index 05146d7b09b8..1e163263aabe 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(ABS([p].[MoneyValue] * 10 MOD 10) = 5 AND ([p].[MoneyValue] MOD 2) = 2, [p].[MoneyValue], ROUND([p].[MoneyValue])) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(ABS([t].[MoneyValue] * 10 MOD 10) = 5 AND ([t].[MoneyValue] MOD 2) = 2, [t].[MoneyValue], ROUND([t].[MoneyValue])) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb).sql index 4f2477d275ba..3dae100e230f 100644 --- a/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Access.Jet.OleDb).sql @@ -2,9 +2,14 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + Int([p].[MoneyValue] * (10 ^ 1) + IIF([p].[MoneyValue] >= 0, 0.5, -0.5)) / (10 ^ 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb).sql index 4c52c52c5a88..1d2cbcbdc1e4 100644 --- a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Access.Jet.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb).sql index 4c52c52c5a88..1d2cbcbdc1e4 100644 --- a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Access.Jet.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb).sql index 73913367ba90..eb3e9d09ea50 100644 --- a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Access.Jet.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb).sql index 73913367ba90..eb3e9d09ea50 100644 --- a/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Access.Jet.OleDb).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- Access.Jet.OleDb AccessOleDb @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/Access.Jet.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb).sql index 125978dc53c1..1de622b126ca 100644 --- a/Access.Jet.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(Access.Jet.OleDb).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON ([t1].[Value1] = [pp].[Value1]) ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/Access.Jet.OleDb/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.OleDb).sql new file mode 100644 index 000000000000..4f49070208b7 --- /dev/null +++ b/Access.Jet.OleDb/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(Access.Jet.OleDb).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- Access.Jet.OleDb AccessOleDb + +SELECT + IIF([t].[Value2] IS NULL, '', [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.OleDb AccessOleDb + +SELECT + IIF([t].[Value3] IS NULL, '', [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.OleDb AccessOleDb + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value1] IS NULL, '', ' -> ' + [t].[Value1]) + IIF([t].[Value2] IS NULL, '', ' -> ' + [t].[Value2]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- Access.Jet.OleDb AccessOleDb + +SELECT + Mid(IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]) + IIF([t].[Value3] IS NULL, '', ' -> ' + [t].[Value3]), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/Access.Jet.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb).sql index 6b84abe3bd6a..d00dd24dbdac 100644 --- a/Access.Jet.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4458Test1(Access.Jet.OleDb).sql @@ -35,13 +35,20 @@ SELECT [i].[Id], ( SELECT - SUM([stock].[QuantityAvailable]) + SUM([s].[QuantityAvailable]) FROM - [WarehouseStock] [stock] + [WarehouseStock] [s] WHERE - [stock].[ItemId] = [i].[Id] - GROUP BY - [stock].[ItemId] + [s].[ItemId] = [i].[Id] AND ( + SELECT + [stock].[ItemId] + FROM + [WarehouseStock] [stock] + WHERE + [stock].[ItemId] = [i].[Id] + GROUP BY + [stock].[ItemId] + ) = [s].[ItemId] ) FROM [Issue4458Item] [i] diff --git a/Access.Jet.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb).sql index 866dfb255aa3..3188a35b49af 100644 --- a/Access.Jet.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Access.Jet.OleDb).sql @@ -2,12 +2,12 @@ -- Access.Jet.OleDb AccessOleDb SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/Access.Jet.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Access.Jet.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index f25634548ce0..c0c8031b0e91 100644 --- a/Access.Jet.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Access.Jet.OleDb/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Access.Jet.OleDb,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON ([m_1].[ID] = [d].[ParentId]) + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb).sql index b25dbbff26a7..3b83af12c65d 100644 --- a/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Access.Jet.OleDb).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb).sql index 42bc654e424d..144c52cb74d2 100644 --- a/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Access.Jet.OleDb).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.OleDb).sql index e1aa103ec229..419166d67bfc 100644 --- a/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(Access.Jet.OleDb).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.OleDb).sql index e1aa103ec229..419166d67bfc 100644 --- a/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Access.Jet.OleDb).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP 1 + [a_Parent].[ParentID] FROM - ( - SELECT TOP 1 - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON ([t1].[ParentID] = [a_Parent].[ParentID]) ) [m_1] INNER JOIN [Child] [d] ON ([m_1].[ParentID] = [d].[ParentID]) diff --git a/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb).sql index 8ab6c43c1378..b95a555bfb7e 100644 --- a/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Access.Jet.OleDb).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb).sql index 5379f358521b..513b93a1cb33 100644 --- a/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Access.Jet.OleDb).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/Access.Jet.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb).sql index e5ed12a5b8af..ca5dd3534ef1 100644 --- a/Access.Jet.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Access.Jet.OleDb).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb).sql index 0af904591f96..65b6015a86ad 100644 --- a/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Access.Jet.OleDb).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb).sql b/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb).sql index 0af904591f96..65b6015a86ad 100644 --- a/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb).sql +++ b/Access.Jet.OleDb/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Access.Jet.OleDb).sql @@ -9,9 +9,9 @@ SET WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/ClickHouse.Driver.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..2e31e065ccd3 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + avgOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Driver.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..0b78fddd0d06 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + minOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Driver.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver.LinqService).sql index e0de29627bbe..6920823b5307 100644 --- a/ClickHouse.Driver.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p.ParentID, p.Value1, - t1.COUNT_1 + t1.Count_1 FROM ( SELECT /* Inline */ c_1.ParentID as ParentID, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver.LinqService).sql index 783600579859..e5d006829652 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - avg(c_1.ChildID), + avgOrNull(c_1.ChildID), AVG(c_1.ChildID), AVG(ALL c_1.ChildID), AVG(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver.LinqService).sql index ff878d90f6f6..bb837c900240 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(c_1.ChildID), + maxOrNull(c_1.ChildID), MAX(c_1.ChildID), MAX(ALL c_1.ChildID), MAX(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver.LinqService).sql index 6517d25def81..e49fc47e02b9 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - min(c_1.ChildID), + minOrNull(c_1.ChildID), MIN(c_1.ChildID), MIN(ALL c_1.ChildID), MIN(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver.LinqService).sql index 204d9307b6dd..122bf5922a08 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver.LinqService).sql @@ -3,7 +3,7 @@ SELECT tt.Key_1, - sum(tt.ID) + sumOrNull(tt.ID) FROM ( SELECT @@ -25,5 +25,5 @@ FROM GROUP BY tt.Key_1 HAVING - sum(tt.ID) <> 0 + sumOrNull(tt.ID) <> 0 OR sumOrNull(tt.ID) IS NULL diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver.LinqService).sql index 37be4f6af2a8..9070f3a497c7 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - p.ID + toString(toUInt8(p.ID)) FROM LinqDataTypes p WHERE diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver.LinqService).sql index ae5515e05d2c..4126b4513932 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver.LinqService).sql @@ -11,7 +11,7 @@ FROM Child g_1 GROUP BY g_1.ParentID - ) g_2 + ) t1 WHERE - g_2.ParentID > 2 + t1.ParentID > 2 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver.LinqService).sql index 817a4fc87000..c448301084ac 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver.LinqService).sql index aa8bee5a6dc0..d289262dbab0 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver.LinqService).sql index 2a60d0a8d08f..44e003eddcce 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver.LinqService).sql @@ -3,7 +3,7 @@ SELECT COUNT(*), - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver.LinqService).sql index b36723a4e92e..1be5fb063dad 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.Key_1 < 5 + g_2.Count_1 > 2 AND g_2.Key_1 < 5 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver.LinqService).sql index c28ba0cb11fc..5cd39eb57f9c 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2.Key_1 = 1 + g_2.Count_1 > 3 OR g_2.Key_1 = 1 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..aee701270227 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e.Date DESC) as RowNumber, + e.Name as Name, + e.Date as Date_1, + e.Id as Id, + e.Group as Group_1, + e.Amount as Amount, + e.IsActive as IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = toInt64(1) +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.Name, + t1.Group, + t1.Date, + t1.Amount, + t1.IsActive +FROM + TestData t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver.LinqService).sql index 0fa6cf4e1799..17dfab8cf314 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(Coalesce(a_Parent.Value1, 0)) + sumOrNull(Coalesce(a_Parent.Value1, 0)) FROM Child grp LEFT JOIN Parent a_Parent ON grp.ParentID = a_Parent.ParentID diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver.LinqService).sql index 0ee1e616f28b..e31e81dcc375 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver.LinqService).sql @@ -3,10 +3,10 @@ SELECT COUNT(*), - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID) + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver.LinqService).sql index 484ad5c8b19e..3461166d85bc 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver.LinqService).sql @@ -2,10 +2,10 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID), + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID), COUNT(*) FROM Child g_1 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver.LinqService).sql index 188fdef4e04c..d46452ee773f 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(c2.ChildID) + sumOrNull(c2.ChildID) FROM Child g_1 INNER JOIN Child c2 ON g_1.ChildID = c2.ChildID + 1 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..d9e7d6f21b8d --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,49 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t.GroupId, + COUNT(*), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t.DataValue), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT t.DataValue) +FROM + AggregationData t +WHERE + t.DataValue IS NOT NULL +GROUP BY + t.GroupId + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.GroupId, + t1.DataValue +FROM + AggregationData t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver.LinqService).sql index b75f8dab9141..7256e9a5535a 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver.LinqService).sql @@ -10,5 +10,5 @@ GROUP BY a_Parent.ParentID, a_Parent.Value1 HAVING - max(g_1.ParentID) > 2 + maxOrNull(g_1.ParentID) > 2 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver.LinqService).sql index d52468a3986e..fdf1e6a43221 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent.ParentID as ParentID, - COUNT(*) as COUNT_1, + COUNT(*) as Count_1, a_Parent.Value1 as Value1 FROM GrandChild g_1 @@ -17,5 +17,5 @@ FROM a_Parent.Value1 ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.ParentID <> 1 + g_2.Count_1 > 2 AND g_2.ParentID <> 1 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver.LinqService).sql index c01ebbaa9fd6..54e8c62f1cfc 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver.LinqService).sql index c01ebbaa9fd6..54e8c62f1cfc 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver.LinqService).sql index 48563776f3cf..36e88c06cc43 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM @@ -20,7 +20,7 @@ BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver.LinqService).sql index 2168ea1d89b0..2e06204496a1 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver.LinqService).sql @@ -3,7 +3,7 @@ SELECT t1.ChildID, - avg(t1.ParentID) + avgOrNull(t1.ParentID) FROM Child t1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver.LinqService).sql index a17a3af30a8e..d208208dc258 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver.LinqService).sql index c7c8932331bb..14018f3dbff7 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT ip.InvestorId, t1.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id @@ -12,7 +12,7 @@ FROM INNER JOIN PaymentCalculation pc ON ipd.CalculationId = pc.Id AND p.Id = pc.EventId INNER JOIN ( SELECT - sum(b.Units) as Units, + sumOrNull(b.Units) as Units, b.InvestorId as InvestorId, b.SecurityClass as SecurityClass FROM diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver.LinqService).sql index 002f64641ac6..85f371af5f4b 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver.LinqService).sql @@ -6,7 +6,7 @@ WITH CTE_1 AS SELECT g_1.InvestorId, g_1.SecurityClass, - sum(g_1.Units) as Units + sumOrNull(g_1.Units) as Units FROM Transaction g_1 GROUP BY @@ -16,7 +16,7 @@ WITH CTE_1 AS SELECT ip.InvestorId, b.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver.LinqService).sql index 7a21c74d2249..97673663fa1c 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT t_1.FinalCustomerId, t_1.IsActive, - sum(t_1.Amount) + sumOrNull(t_1.Amount) FROM ( SELECT diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver.LinqService).sql index 3233ae465a55..6a40b8ae0b30 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver.LinqService).sql @@ -19,7 +19,7 @@ WHERE GROUP BY x.ParentID ORDER BY - max(x.ChildID) DESC + maxOrNull(x.ChildID) DESC LIMIT 2 ) t1 ) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver.LinqService).sql index 306a219ecdc9..e2d7b9e7826a 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver.LinqService).sql @@ -8,7 +8,7 @@ FROM Child ch INNER JOIN ( SELECT - max(max_1.ChildID) as c1 + maxOrNull(max_1.ChildID) as c1 FROM Child max_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver.LinqService).sql index af179b5a4185..126524bdfb07 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver.LinqService).sql @@ -8,7 +8,7 @@ FROM INNER JOIN ( SELECT t2.ID as ID, - max(t2.DateTimeValue) as c1 + maxOrNull(t2.DateTimeValue) as c1 FROM LinqDataTypes t2 WHERE diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver.LinqService).sql index 49ef4d7e1309..8b3fb0c6c2d6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver.LinqService).sql index eb9c44969406..043a8ad86c49 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver.LinqService).sql index d36ffce07537..df37422c5b5e 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver.LinqService).sql @@ -2,8 +2,8 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(g_1.ChildID), - max(g_1.ChildID + g_1.ParentID) + maxOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID + g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver.LinqService).sql index cfa07b1b6d3b..5f4a581400f6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver.LinqService).sql @@ -2,23 +2,23 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - g_2.MIN_2 + g_2.Min_2 FROM ( SELECT minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1, + END) as Min_1, minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_2 + END) as Min_2 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2.Min_1 IS NOT NULL diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver.LinqService).sql index 04197d6b02c4..8e88a9fa0848 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - g_2.MIN_1 + g_2.Min_1 FROM ( SELECT @@ -13,7 +13,7 @@ FROM minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1 + END) as Min_1 FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver.LinqService).sql index c94d336156f7..696fa3ac5d6e 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver.LinqService).sql index d532b292febd..3a6c5a4e14fb 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver.LinqService).sql index d532b292febd..3a6c5a4e14fb 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver.LinqService).sql index 49ef4d7e1309..8b3fb0c6c2d6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver.LinqService).sql index e5473f0bfd83..0deefb670e67 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver.LinqService).sql index e5473f0bfd83..0deefb670e67 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver.LinqService).sql index e5473f0bfd83..0deefb670e67 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver.LinqService).sql index 47943e302b41..b50f48408271 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.n, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver.LinqService).sql index 5b5fc2c68d6b..3ecefdd6b3a7 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 LEFT JOIN Parent p ON g_1.ParentID = p.ParentID diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver.LinqService).sql index f015ba4c50f8..b142e69f5d34 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver.LinqService).sql index f015ba4c50f8..b142e69f5d34 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver.LinqService).sql index 9e1b98aa4f01..07505a53ac15 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - sum(g_2.ParentID - 3) + sumOrNull(g_2.ParentID - 3) FROM ( SELECT diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver.LinqService).sql index 9672eef2a9ed..de8abd865893 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver.LinqService).sql index 413a12d6c0d0..1a291bcd84d6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver.LinqService).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver.LinqService).sql index 5f33bc89f814..fe45990bc512 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,1).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,1).sql index 4cb9d8034c62..82b75abcbc24 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,1).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,2).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,2).sql index 4cb9d8034c62..82b75abcbc24 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,2).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,1).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,1).sql index 413a12d6c0d0..1a291bcd84d6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,1).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,2).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,2).sql index 413a12d6c0d0..1a291bcd84d6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,2).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver.LinqService).sql index 3f79efd80fdb..348c73c061c3 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver.LinqService).sql index 413a12d6c0d0..1a291bcd84d6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver.LinqService).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver.LinqService).sql index 5f33bc89f814..fe45990bc512 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver.LinqService).sql index 22f801a871fa..baa0967ab8a0 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver.LinqService).sql index 9672eef2a9ed..de8abd865893 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver.LinqService).sql index 3f79efd80fdb..348c73c061c3 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver.LinqService).sql index 4cf8c4a7c2aa..865d1dc06ddb 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue, 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue, 1) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver.LinqService).sql index 07f7be802b61..e23931c8239a 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver.LinqService).sql index 07f7be802b61..e23931c8239a 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver.LinqService).sql index 7853ed6b5560..14dbc6f4a977 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver.LinqService).sql index 7853ed6b5560..14dbc6f4a977 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver.LinqService).sql index 44d33b3b7611..32f6bb700559 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver.LinqService).sql @@ -17,7 +17,7 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1) + maxOrNull(x.OrderData1) LIMIT 0, 3 BeforeExecute @@ -39,6 +39,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - min(x.OrderData1) DESC + minOrNull(x.OrderData1) DESC LIMIT 0, 3 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver.LinqService).sql index 75927e4fe5a9..515323001771 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver.LinqService).sql @@ -17,6 +17,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1 % 3) + maxOrNull(x.OrderData1 % 3) LIMIT 0, 3 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver.LinqService).sql index 1b8b6c91d49b..301e7ce61995 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver.LinqService).sql index 1b8b6c91d49b..301e7ce61995 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver.LinqService).sql index 1b8b6c91d49b..301e7ce61995 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver.LinqService).sql index def8e8c39401..6335619d96e6 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver.LinqService).sql @@ -5,13 +5,13 @@ SELECT COUNT(*) OVER(), x.Key_1, x.Count_1, - x.MAX_1 + x.Max_1 FROM ( SELECT summary.LastName as Key_1, COUNT(*) as Count_1, - max(summary.FirstName) as MAX_1 + maxOrNull(summary.FirstName) as Max_1 FROM Person summary GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver.LinqService).sql index 7c28463d518c..1bda4318f7dd 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver.LinqService).sql @@ -10,7 +10,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 @@ -33,7 +33,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver.LinqService).sql index 279d7e6fe6e1..3503892cb1ae 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver.LinqService).sql @@ -8,7 +8,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - toInt64(1) as Index_1, p.FirstName as FirstName, p.LastName as LastName, p.PersonID as PersonID @@ -16,7 +16,7 @@ FROM Person p ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.PersonID DESC diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver.LinqService).sql index 4c63a82b358c..b97943406114 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver.LinqService).sql @@ -7,7 +7,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - toInt64(1) as Index_1, g_2.Key_1 as Key_1 FROM ( @@ -20,7 +20,7 @@ FROM ) g_2 ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.Key_1 DESC diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..fdd0b42d4652 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + Coalesce(t.Value2, '') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + Coalesce(t.Value3, '') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + arrayStringConcat([t.Value3, t.Value1, t.Value2], ' -> ') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + arrayStringConcat([t.Value3, t.Value3], ' -> ') +FROM + SampleClass t +ORDER BY + t.Id + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..d78b6fc576cd --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + arrayStringConcat([CASE + WHEN position(t.NullableValue, 'A') > 0 THEN t.NullableValue + ELSE NULL + END, CASE + WHEN position(t.NotNullableValue, 'A') > 0 THEN t.NotNullableValue + ELSE NULL + END, CASE + WHEN position(t.VarcharValue, 'A') > 0 THEN t.VarcharValue + ELSE NULL + END, CASE + WHEN position(t.NVarcharValue, 'A') > 0 THEN t.NVarcharValue + ELSE NULL + END], ', ') as c1 + FROM + SampleClass t + ) x +WHERE + NOT empty(replaceRegexpAll(coalesce(x.c1, ''), ' | +| | | | |…| | | | | | | | | | | | | |
|
| | ', '')) + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..ac3257f2ff61 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((t1.NotNullableValue, toString(Coalesce(t1.NullableValue, '')))))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..66c80bd8b257 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..66c80bd8b257 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..d6e45609832e --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(groupArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + arrayStringConcat(groupArray(toString(g_1.NotNullableValue)), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..3e6a0febcabf --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupUniqArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL)))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupUniqArray((Coalesce(g_1.NullableValue, ''), toString(Coalesce(g_1.NullableValue, ''))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..6d6cb4fa8647 --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((g_1.NullableValue, toString(Coalesce(g_1.NullableValue, '')))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Driver.LinqService).sql new file mode 100644 index 000000000000..f4d6c69c156c --- /dev/null +++ b/ClickHouse.Driver.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Driver.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(groupUniqArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + Coalesce(arrayStringConcat(groupUniqArrayIf(toString(g_1.NullableValue), g_1.NullableValue IS NOT NULL), ', '), ''), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArrayIf((g_1.NullableValue, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))))), ', '), + arrayStringConcat(groupUniqArray(toString(g_1.NotNullableValue)), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArray((g_1.NotNullableValue, toString(g_1.NotNullableValue))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver.LinqService).sql index 584caff3f937..15534434f2e0 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver.LinqService).sql index 584caff3f937..15534434f2e0 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver.LinqService).sql index f3219220fbef..440f80d110f2 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(f.added) + maxOrNull(f.added) FROM activity649 f INNER JOIN person649 a_Person ON f.personid = a_Person.personid diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver.LinqService).sql index be95a4fa8221..d564e675f9a3 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver.LinqService).sql @@ -4,7 +4,7 @@ SELECT data_1.ParentID, data_1.ChildID, - max(data_1.ChildID) + maxOrNull(data_1.ChildID) FROM Child data_1 GROUP BY diff --git a/ClickHouse.Driver.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver.LinqService).sql index ada09f6e5d75..2bdb1db44225 100644 --- a/ClickHouse.Driver.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver.LinqService).sql @@ -2,12 +2,12 @@ -- ClickHouse.Driver ClickHouse (asynchronously) SELECT - g_1.COUNT_1 + g_1.Count_1 FROM ( SELECT c_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1.ParentID > 1 ) g_1 WHERE - g_1.Key_1 > 1 AND g_1.COUNT_1 > 1 + g_1.Key_1 > 1 AND g_1.Count_1 > 1 diff --git a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver.LinqService).sql index 08273553e806..3a038d4ab4ff 100644 --- a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver.LinqService).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver.LinqService).sql index 43ae59a334d3..28abab1c2b8c 100644 --- a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver.LinqService).sql @@ -3,11 +3,11 @@ SELECT (toFloat64(COUNT(*)) * toFloat64(100)) / SUM(COUNT(*)) OVER(), - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 GROUP BY g_1.ParentID HAVING - sum(g_1.ParentID) <> 36 + sumOrNull(g_1.ParentID) <> 36 OR sumOrNull(g_1.ParentID) IS NULL diff --git a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver.LinqService).sql index e7b7971ff5e3..6a3c6e982653 100644 --- a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver.LinqService).sql @@ -18,7 +18,7 @@ FROM vpc.CategoryId as CategoryId, pop.ProductId as ProductId, COALESCE(pcc.PeriodOrderLimit,0) as MaxCapacity, - COALESCE(COALESCE(vsp.SUM_1,0),0) as Quantity + COALESCE(COALESCE(vsp.Quantity,0),0) as Quantity FROM OrderPeriod op INNER JOIN ProductsPerOrderPeriod pop ON op.Id = pop.OrderPeriodId @@ -28,7 +28,7 @@ FROM SELECT agroup.Id as Id, oi.ProductId as ProductId, - sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as SUM_1 + sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as Quantity FROM OrderPeriod agroup LEFT JOIN OrderHeader oh ON agroup.Id = oh.PeriodId diff --git a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver.LinqService).sql b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver.LinqService).sql index 4806a055be96..28eaae7079ec 100644 --- a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver.LinqService).sql +++ b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver.LinqService).sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - min(elements_1.TesteeId) as TesteeId + minOrNull(elements_1.TesteeId) as TesteeId FROM ( SELECT diff --git a/ClickHouse.Driver/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Driver).sql new file mode 100644 index 000000000000..b514e904ca2b --- /dev/null +++ b/ClickHouse.Driver/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Driver).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + avgOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Driver/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Driver).sql new file mode 100644 index 000000000000..085b518c6f48 --- /dev/null +++ b/ClickHouse.Driver/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Driver).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + minOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Driver/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver).sql index 6593bfa90197..98e9b49ae6e6 100644 --- a/ClickHouse.Driver/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Driver).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p.ParentID, p.Value1, - t1.COUNT_1 + t1.Count_1 FROM ( SELECT /* Inline */ c_1.ParentID as ParentID, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver).sql index 9fa22a6a3b69..9f3f338b63c7 100644 --- a/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - avg(c_1.ChildID), + avgOrNull(c_1.ChildID), AVG(c_1.ChildID), AVG(ALL c_1.ChildID), AVG(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver).sql index 0a6223f88c6e..7847a98fe110 100644 --- a/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(c_1.ChildID), + maxOrNull(c_1.ChildID), MAX(c_1.ChildID), MAX(ALL c_1.ChildID), MAX(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver).sql index 27909807acf8..57f4aa07e307 100644 --- a/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - min(c_1.ChildID), + minOrNull(c_1.ChildID), MIN(c_1.ChildID), MIN(ALL c_1.ChildID), MIN(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Driver/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver).sql index f4565083e4d3..5456d6b0e562 100644 --- a/ClickHouse.Driver/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Driver).sql @@ -3,7 +3,7 @@ SELECT tt.Key_1, - sum(tt.ID) + sumOrNull(tt.ID) FROM ( SELECT @@ -25,5 +25,5 @@ FROM GROUP BY tt.Key_1 HAVING - sum(tt.ID) <> 0 + sumOrNull(tt.ID) <> 0 OR sumOrNull(tt.ID) IS NULL diff --git a/ClickHouse.Driver/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver).sql index 0cbd4b275c6b..07f7b3031996 100644 --- a/ClickHouse.Driver/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - p.ID + toString(toUInt8(p.ID)) FROM LinqDataTypes p WHERE diff --git a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver).sql index 85d18847d823..067089ec70d6 100644 --- a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Driver).sql @@ -11,7 +11,7 @@ FROM Child g_1 GROUP BY g_1.ParentID - ) g_2 + ) t1 WHERE - g_2.ParentID > 2 + t1.ParentID > 2 diff --git a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver).sql index d56e331fbe22..d6111c4343f9 100644 --- a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Driver).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver).sql index 22a6c26d7722..c7c57df4f12a 100644 --- a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Driver).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver).sql index 8e19465a65b8..03299c2cce5d 100644 --- a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Driver).sql @@ -3,7 +3,7 @@ SELECT COUNT(*), - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver).sql index bd3aa7daf69e..21123fcca099 100644 --- a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Driver).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.Key_1 < 5 + g_2.Count_1 > 2 AND g_2.Key_1 < 5 diff --git a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver).sql index 2afd694a3cd0..2afd1a9ccedc 100644 --- a/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Driver).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2.Key_1 = 1 + g_2.Count_1 > 3 OR g_2.Key_1 = 1 diff --git a/ClickHouse.Driver/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Driver).sql new file mode 100644 index 000000000000..bc4771f2a453 --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Driver).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e.Date DESC) as RowNumber, + e.Name as Name, + e.Date as Date_1, + e.Id as Id, + e.Group as Group_1, + e.Amount as Amount, + e.IsActive as IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = toInt64(1) +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.Id, + t1.Name, + t1.Group, + t1.Date, + t1.Amount, + t1.IsActive +FROM + TestData t1 + diff --git a/ClickHouse.Driver/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Driver).sql index 295ad41cf90d..e66909ebe696 100644 --- a/ClickHouse.Driver/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Driver).sql @@ -3,10 +3,10 @@ SELECT m_2.MasterId, - d.Id1, - d.Id2, - d.Value, - d.ByteValues + t3.Id1, + t3.Id2, + t3.Value_1, + t3.ByteValues FROM ( SELECT DISTINCT @@ -23,7 +23,24 @@ FROM ) t1 INNER JOIN DetailClass dd ON t1.Id1 = dd.MasterId ) m_2 - INNER JOIN MasterClass d ON d.Id1 = m_2.MasterId + INNER JOIN ( + SELECT + t2.Id1 as Id1 + FROM + MasterClass t2 + GROUP BY + t2.Id1 + ) d ON d.Id1 = m_2.MasterId + INNER JOIN ( + SELECT + mm.Id1 as Id1, + mm.Id2 as Id2, + mm.Value as Value_1, + mm.ByteValues as ByteValues, + ROW_NUMBER() OVER (PARTITION BY mm.Id1 ORDER BY mm.Id1) as rn + FROM + MasterClass mm + ) t3 ON t3.Id1 = m_2.MasterId AND d.Id1 = t3.Id1 AND t3.rn <= 1 BeforeExecute -- ClickHouse.Driver ClickHouse diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver).sql index 9883739a3da8..0cd22378bbfa 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(Coalesce(a_Parent.Value1, 0)) + sumOrNull(Coalesce(a_Parent.Value1, 0)) FROM Child grp LEFT JOIN Parent a_Parent ON grp.ParentID = a_Parent.ParentID diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver).sql index 4a6a4492b022..139f12ecb77e 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Driver).sql @@ -3,10 +3,10 @@ SELECT COUNT(*), - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID) + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver).sql index 54e2132dbd72..47ee6a3d9153 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Driver).sql @@ -2,10 +2,10 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID), + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID), COUNT(*) FROM Child g_1 diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver).sql index 91f33ef35041..ea48c8356559 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(c2.ChildID) + sumOrNull(c2.ChildID) FROM Child g_1 INNER JOIN Child c2 ON g_1.ChildID = c2.ChildID + 1 diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Driver).sql new file mode 100644 index 000000000000..132b4102893b --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Driver).sql @@ -0,0 +1,49 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t.GroupId, + COUNT(*), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t.DataValue), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT t.DataValue) +FROM + AggregationData t +WHERE + t.DataValue IS NOT NULL +GROUP BY + t.GroupId + +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.GroupId, + t1.DataValue +FROM + AggregationData t1 + diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver).sql index 1984197adfc1..93785f8d4a18 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Driver).sql @@ -10,5 +10,5 @@ GROUP BY a_Parent.ParentID, a_Parent.Value1 HAVING - max(g_1.ParentID) > 2 + maxOrNull(g_1.ParentID) > 2 diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver).sql index ebb7b7b2f7bd..a5830cf72bba 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Driver).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent.ParentID as ParentID, - COUNT(*) as COUNT_1, + COUNT(*) as Count_1, a_Parent.Value1 as Value1 FROM GrandChild g_1 @@ -17,5 +17,5 @@ FROM a_Parent.Value1 ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.ParentID <> 1 + g_2.Count_1 > 2 AND g_2.ParentID <> 1 diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver).sql index cdb64fa176b6..a3465b3b6337 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver).sql index cdb64fa176b6..a3465b3b6337 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver).sql index 520b4be7c6ba..b6ee9ce57599 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM @@ -20,7 +20,7 @@ BeforeExecute -- ClickHouse.Driver ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver).sql index 5e676d7bbf4a..e368d71afa27 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Driver).sql @@ -3,7 +3,7 @@ SELECT t1.ChildID, - avg(t1.ParentID) + avgOrNull(t1.ParentID) FROM Child t1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver).sql index a9f16d040467..a75481d8d994 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Driver).sql index e57c4b456e4f..e924b2bca928 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT gr.FirstName, gr.LastName, - sum(gr.PersonID) + sumOrNull(gr.PersonID) FROM Person gr GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Driver).sql index e57c4b456e4f..e924b2bca928 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT gr.FirstName, gr.LastName, - sum(gr.PersonID) + sumOrNull(gr.PersonID) FROM Person gr GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver).sql index 4a27ba702ae8..4a1bce12d426 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT ip.InvestorId, t1.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id @@ -12,7 +12,7 @@ FROM INNER JOIN PaymentCalculation pc ON ipd.CalculationId = pc.Id AND p.Id = pc.EventId INNER JOIN ( SELECT - sum(b.Units) as Units, + sumOrNull(b.Units) as Units, b.InvestorId as InvestorId, b.SecurityClass as SecurityClass FROM diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver).sql index 1ed6550e38e6..2929daa6c4a6 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Driver).sql @@ -6,7 +6,7 @@ WITH CTE_1 AS SELECT g_1.InvestorId, g_1.SecurityClass, - sum(g_1.Units) as Units + sumOrNull(g_1.Units) as Units FROM Transaction g_1 GROUP BY @@ -16,7 +16,7 @@ WITH CTE_1 AS SELECT ip.InvestorId, b.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver).sql index 95b8d85b7475..bcc7b1389a69 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT t_1.FinalCustomerId, t_1.IsActive, - sum(t_1.Amount) + sumOrNull(t_1.Amount) FROM ( SELECT diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver).sql index 39592809f00f..99601e90b268 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Driver).sql @@ -19,7 +19,7 @@ WHERE GROUP BY x.ParentID ORDER BY - max(x.ChildID) DESC + maxOrNull(x.ChildID) DESC LIMIT 2 ) t1 ) diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver).sql index fe16cee5d998..99a4f16124ef 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Driver).sql @@ -8,7 +8,7 @@ FROM Child ch INNER JOIN ( SELECT - max(max_1.ChildID) as c1 + maxOrNull(max_1.ChildID) as c1 FROM Child max_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver).sql index 35cfc173d3c4..8e56aa780f86 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Driver).sql @@ -8,7 +8,7 @@ FROM INNER JOIN ( SELECT t2.ID as ID, - max(t2.DateTimeValue) as c1 + maxOrNull(t2.DateTimeValue) as c1 FROM LinqDataTypes t2 WHERE diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver).sql index 3cd06a51f6c7..a5c8dca4732f 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver).sql index 9f5268795e81..34d0fe049c42 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver).sql index 443fcaa08d7d..dac239fac0a3 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Driver).sql @@ -2,8 +2,8 @@ -- ClickHouse.Driver ClickHouse SELECT - max(g_1.ChildID), - max(g_1.ChildID + g_1.ParentID) + maxOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID + g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver).sql index cf4e476a761b..56f183fbe7c8 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Driver).sql @@ -2,23 +2,23 @@ -- ClickHouse.Driver ClickHouse SELECT - g_2.MIN_2 + g_2.Min_2 FROM ( SELECT minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1, + END) as Min_1, minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_2 + END) as Min_2 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2.Min_1 IS NOT NULL diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver).sql index de5ca5d79783..7b86af62688e 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - g_2.MIN_1 + g_2.Min_1 FROM ( SELECT @@ -13,7 +13,7 @@ FROM minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1 + END) as Min_1 FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver).sql index aa16c1a403fc..689b660a782e 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver).sql index 88f91f894de6..7a0957f1d182 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver).sql index 88f91f894de6..7a0957f1d182 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver).sql index 3cd06a51f6c7..a5c8dca4732f 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver).sql index 0269905f6306..655ba7211d28 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Driver).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver).sql index 0269905f6306..655ba7211d28 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Driver).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver).sql index 0269905f6306..655ba7211d28 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Driver).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver).sql index 0bed36141709..c722d3610798 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Driver).sql @@ -3,7 +3,7 @@ SELECT g_2.n, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver).sql index d79ba7b5980e..9917fd370f19 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 LEFT JOIN Parent p ON g_1.ParentID = p.ParentID diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver).sql index ed82d25bcf0d..b8afad41680b 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver).sql index ed82d25bcf0d..b8afad41680b 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver).sql index f41b5db6b420..617a7fa45903 100644 --- a/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Driver).sql @@ -2,7 +2,7 @@ -- ClickHouse.Driver ClickHouse SELECT - sum(g_2.ParentID - 3) + sumOrNull(g_2.ParentID - 3) FROM ( SELECT diff --git a/ClickHouse.Driver/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Driver).sql index 8751e3a5700f..dd8252b6c5bd 100644 --- a/ClickHouse.Driver/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Driver).sql @@ -12,7 +12,7 @@ BeforeExecute SELECT x_1.Key_1, - sum(x_1.MatchScore) + sumOrNull(x_1.MatchScore) FROM ( SELECT DISTINCT diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver).sql index aee1f2279cb9..09e797d119e4 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver).sql index d4d5f265c004..10e7dc3cb582 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Driver).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver).sql index f41a2516f64e..da59250440c7 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,1).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,1).sql index acd74d68b0de..28d11adba0d0 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,1).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,2).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,2).sql index acd74d68b0de..28d11adba0d0 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,2).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,1).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,1).sql index d4d5f265c004..10e7dc3cb582 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,1).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,2).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,2).sql index d4d5f265c004..10e7dc3cb582 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,2).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Driver,ToEven,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver).sql index e27eb8d600e6..385977ab9f2e 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver).sql index d4d5f265c004..10e7dc3cb582 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Driver).sql @@ -2,12 +2,11 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver).sql index f41a2516f64e..da59250440c7 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver).sql index 2041d2ded4b5..0f19b44853f3 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver).sql index aee1f2279cb9..09e797d119e4 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver).sql index e27eb8d600e6..385977ab9f2e 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver).sql index ec23b89966e3..a8bc8d022867 100644 --- a/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Driver).sql @@ -2,9 +2,14 @@ -- ClickHouse.Driver ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue, 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue, 1) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver).sql index 5893211e7b3a..40aefe0297d7 100644 --- a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Driver).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Driver ClickHouse @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver).sql index 5893211e7b3a..40aefe0297d7 100644 --- a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Driver).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Driver ClickHouse @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver).sql index 9270d26854b6..1b976e75d00c 100644 --- a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Driver).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver).sql index 9270d26854b6..1b976e75d00c 100644 --- a/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Driver).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Driver ClickHouse @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Driver ClickHouse @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver).sql index 7459bba6ca8f..66930e43292e 100644 --- a/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Driver).sql @@ -17,7 +17,7 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1) + maxOrNull(x.OrderData1) LIMIT 0, 3 BeforeExecute @@ -39,6 +39,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - min(x.OrderData1) DESC + minOrNull(x.OrderData1) DESC LIMIT 0, 3 diff --git a/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver).sql index 0cc5462b8c49..25bb7e0030c7 100644 --- a/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Driver).sql @@ -17,6 +17,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1 % 3) + maxOrNull(x.OrderData1 % 3) LIMIT 0, 3 diff --git a/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver).sql index 4db33fe3e86d..e75639c32125 100644 --- a/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver).sql index 4db33fe3e86d..e75639c32125 100644 --- a/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver).sql index 4db33fe3e86d..e75639c32125 100644 --- a/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Driver/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver).sql index b9e1e03d8441..55fd920322a3 100644 --- a/ClickHouse.Driver/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Driver).sql @@ -5,13 +5,13 @@ SELECT COUNT(*) OVER(), x.Key_1, x.Count_1, - x.MAX_1 + x.Max_1 FROM ( SELECT summary.LastName as Key_1, COUNT(*) as Count_1, - max(summary.FirstName) as MAX_1 + maxOrNull(summary.FirstName) as Max_1 FROM Person summary GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver).sql index 6248a7f18e0d..bcc03f6da509 100644 --- a/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Driver).sql @@ -10,7 +10,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 @@ -33,7 +33,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 diff --git a/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver).sql index 4fb3ee48cbfa..9722de32c441 100644 --- a/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Driver).sql @@ -8,7 +8,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - toInt64(1) as Index_1, p.FirstName as FirstName, p.LastName as LastName, p.PersonID as PersonID @@ -16,7 +16,7 @@ FROM Person p ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.PersonID DESC diff --git a/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver).sql index c14f9a4b189b..982bd874fc17 100644 --- a/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Driver).sql @@ -7,7 +7,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - toInt64(1) as Index_1, g_2.Key_1 as Key_1 FROM ( @@ -20,7 +20,7 @@ FROM ) g_2 ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.Key_1 DESC diff --git a/ClickHouse.Driver/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Driver).sql index 5f514f9458ff..f689342f3967 100644 --- a/ClickHouse.Driver/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Driver).sql @@ -2,17 +2,21 @@ -- ClickHouse.Driver ClickHouse SELECT - arrayStringConcat([t.Value2], ' -> ') + Coalesce(t.Value2, '') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.Driver ClickHouse SELECT - arrayStringConcat([t.Value3], ' -> ') + Coalesce(t.Value3, '') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.Driver ClickHouse @@ -21,6 +25,8 @@ SELECT arrayStringConcat([t.Value3, t.Value1, t.Value2], ' -> ') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.Driver ClickHouse @@ -29,4 +35,6 @@ SELECT arrayStringConcat([t.Value3, t.Value3], ' -> ') FROM SampleClass t +ORDER BY + t.Id diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Driver).sql new file mode 100644 index 000000000000..cc1f0cf3a60c --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Driver).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + x.c1 +FROM + ( + SELECT + arrayStringConcat([CASE + WHEN position(t.NullableValue, 'A') > 0 THEN t.NullableValue + ELSE NULL + END, CASE + WHEN position(t.NotNullableValue, 'A') > 0 THEN t.NotNullableValue + ELSE NULL + END, CASE + WHEN position(t.VarcharValue, 'A') > 0 THEN t.VarcharValue + ELSE NULL + END, CASE + WHEN position(t.NVarcharValue, 'A') > 0 THEN t.NVarcharValue + ELSE NULL + END], ', ') as c1 + FROM + SampleClass t + ) x +WHERE + NOT empty(replaceRegexpAll(coalesce(x.c1, ''), ' | +| | | | |…| | | | | | | | | | | | | |
|
| | ', '')) + +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Driver).sql new file mode 100644 index 000000000000..d9d3d70c6e21 --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Driver).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((t1.NotNullableValue, toString(Coalesce(t1.NullableValue, '')))))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Driver).sql new file mode 100644 index 000000000000..66c80bd8b257 --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Driver).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Driver).sql new file mode 100644 index 000000000000..a5e9a17be97e --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Driver).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Driver).sql new file mode 100644 index 000000000000..c3c1e5fd6ce5 --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Driver).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(groupArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + arrayStringConcat(groupArray(toString(g_1.NotNullableValue)), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Driver).sql new file mode 100644 index 000000000000..47f3d5107e11 --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Driver).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupUniqArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL)))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupUniqArray((Coalesce(g_1.NullableValue, ''), toString(Coalesce(g_1.NullableValue, ''))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Driver).sql new file mode 100644 index 000000000000..81a1f86c63c4 --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Driver).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((g_1.NullableValue, toString(Coalesce(g_1.NullableValue, '')))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Driver).sql new file mode 100644 index 000000000000..544e61d4f625 --- /dev/null +++ b/ClickHouse.Driver/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Driver).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(groupUniqArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + Coalesce(arrayStringConcat(groupUniqArrayIf(toString(g_1.NullableValue), g_1.NullableValue IS NOT NULL), ', '), ''), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArrayIf((g_1.NullableValue, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))))), ', '), + arrayStringConcat(groupUniqArray(toString(g_1.NotNullableValue)), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArray((g_1.NotNullableValue, toString(g_1.NotNullableValue))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Driver ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver).sql index a59c46b91a4e..4657dff8ea37 100644 --- a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver).sql index a59c46b91a4e..4657dff8ea37 100644 --- a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver).sql index 794c1b43bc30..83801c653547 100644 --- a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(f.added) + maxOrNull(f.added) FROM activity649 f INNER JOIN person649 a_Person ON f.personid = a_Person.personid diff --git a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver).sql index 4fb6e412770b..8a1797e79d8b 100644 --- a/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT data_1.ParentID, data_1.ChildID, - max(data_1.ChildID) + maxOrNull(data_1.ChildID) FROM Child data_1 GROUP BY diff --git a/ClickHouse.Driver/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver).sql index 67296a87a47c..038d9948beb9 100644 --- a/ClickHouse.Driver/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Driver).sql @@ -2,12 +2,12 @@ -- ClickHouse.Driver ClickHouse SELECT - g_1.COUNT_1 + g_1.Count_1 FROM ( SELECT c_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1.ParentID > 1 ) g_1 WHERE - g_1.Key_1 > 1 AND g_1.COUNT_1 > 1 + g_1.Key_1 > 1 AND g_1.Count_1 > 1 diff --git a/ClickHouse.Driver/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Driver).sql index 1e85fee535f6..48ac76ef5e15 100644 --- a/ClickHouse.Driver/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Driver).sql @@ -4,7 +4,7 @@ SELECT 'Title', it.Title, - sum(it.YearsExperience) + sumOrNull(it.YearsExperience) FROM odata_person it GROUP BY diff --git a/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver).sql index 600d0fc65260..de21b0fe9a64 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Driver).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Driver).sql index 600d0fc65260..de21b0fe9a64 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Driver).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver).sql index eafdae2eb247..c1c7edc3725b 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Driver).sql @@ -3,11 +3,11 @@ SELECT (toFloat64(COUNT(*)) * toFloat64(100)) / SUM(COUNT(*)) OVER(), - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 GROUP BY g_1.ParentID HAVING - sum(g_1.ParentID) <> 36 + sumOrNull(g_1.ParentID) <> 36 OR sumOrNull(g_1.ParentID) IS NULL diff --git a/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Driver).sql index 693c0624f287..6a860ae3ce51 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Driver).sql @@ -7,17 +7,12 @@ SELECT d.ChildID FROM ( - SELECT DISTINCT - t2.ParentID as ParentID + SELECT + a_Parent.ParentID as ParentID FROM - ( - SELECT - a_Parent.ParentID as ParentID - FROM - Child t1 - LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID - LIMIT 1 - ) t2 + Child t1 + LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID + LIMIT 1 ) m_1 INNER JOIN Child d ON m_1.ParentID = d.ParentID diff --git a/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Driver).sql index 693c0624f287..6a860ae3ce51 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Driver).sql @@ -7,17 +7,12 @@ SELECT d.ChildID FROM ( - SELECT DISTINCT - t2.ParentID as ParentID + SELECT + a_Parent.ParentID as ParentID FROM - ( - SELECT - a_Parent.ParentID as ParentID - FROM - Child t1 - LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID - LIMIT 1 - ) t2 + Child t1 + LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID + LIMIT 1 ) m_1 INNER JOIN Child d ON m_1.ParentID = d.ParentID diff --git a/ClickHouse.Driver/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Driver).sql index 0454bb6a939e..4dbde9eb50ca 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Driver).sql @@ -9,7 +9,7 @@ SELECT END, CASE WHEN i.SettlementTotalOnIssue IS NOT NULL THEN i.SettlementTotalOnIssue - WHEN ia.InvoiceID IS NOT NULL THEN ia.SUM_1 + WHEN ia.InvoiceId IS NOT NULL THEN ia.Total ELSE NULL END FROM @@ -17,8 +17,8 @@ FROM LEFT JOIN InvoiceReferenceNumber r ON r.InvoiceReferenceNumberID = i.InvoiceReferenceNumberID LEFT JOIN ( SELECT - g_1.InvoiceID as InvoiceID, - sum(ili.BillingAmountOverride) as SUM_1 + g_1.InvoiceID as InvoiceId, + sumOrNull(ili.BillingAmountOverride) as Total FROM Invoice g_1 INNER JOIN InvoiceLineItem ili ON ili.OwningInvoiceID = g_1.InvoiceID @@ -26,7 +26,7 @@ FROM NOT ili.Suppressed GROUP BY g_1.InvoiceID - ) ia ON ia.InvoiceID = i.InvoiceID + ) ia ON ia.InvoiceId = i.InvoiceID BeforeExecute -- ClickHouse.Driver ClickHouse @@ -52,7 +52,7 @@ SELECT ELSE r.ReferenceNumber END, CASE - WHEN ia.InvoiceID IS NOT NULL THEN ia.SUM_1 + WHEN ia.InvoiceId IS NOT NULL THEN ia.Total ELSE NULL END FROM @@ -60,8 +60,8 @@ FROM LEFT JOIN InvoiceReferenceNumber r ON r.InvoiceReferenceNumberID = i.InvoiceReferenceNumberID LEFT JOIN ( SELECT - g_1.InvoiceID as InvoiceID, - sum(ili.BillingAmountOverride) as SUM_1 + g_1.InvoiceID as InvoiceId, + sumOrNull(ili.BillingAmountOverride) as Total FROM Invoice g_1 INNER JOIN InvoiceLineItem ili ON ili.OwningInvoiceID = g_1.InvoiceID @@ -69,5 +69,5 @@ FROM NOT ili.Suppressed GROUP BY g_1.InvoiceID - ) ia ON ia.InvoiceID = i.InvoiceID + ) ia ON ia.InvoiceId = i.InvoiceID diff --git a/ClickHouse.Driver/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Driver).sql index b2c90d5b43ab..17366249a7a5 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Driver).sql @@ -2,7 +2,11 @@ -- ClickHouse.Driver ClickHouse SELECT - concat('Issue1977Table/', toString(f.firstField), '/', toString(f.secondField)) = arrayStringConcat(['Issue1977Table', toString(f.firstField), toString(f.secondField)], '/') + CASE + WHEN concat('Issue1977Table/', toString(f.firstField), '/', toString(f.secondField)) = arrayStringConcat(['Issue1977Table', toString(f.firstField), toString(f.secondField)], '/') + THEN true + ELSE false + END FROM Issue1977Table f diff --git a/ClickHouse.Driver/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver).sql index 3d0e6b005f22..468cf87571de 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Driver).sql @@ -18,7 +18,7 @@ FROM vpc.CategoryId as CategoryId, pop.ProductId as ProductId, COALESCE(pcc.PeriodOrderLimit,0) as MaxCapacity, - COALESCE(COALESCE(vsp.SUM_1,0),0) as Quantity + COALESCE(COALESCE(vsp.Quantity,0),0) as Quantity FROM OrderPeriod op INNER JOIN ProductsPerOrderPeriod pop ON op.Id = pop.OrderPeriodId @@ -28,7 +28,7 @@ FROM SELECT agroup.Id as Id, oi.ProductId as ProductId, - sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as SUM_1 + sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as Quantity FROM OrderPeriod agroup LEFT JOIN OrderHeader oh ON agroup.Id = oh.PeriodId diff --git a/ClickHouse.Driver/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver).sql b/ClickHouse.Driver/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver).sql index 3e59abffb064..90ac070a3a84 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Driver).sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - min(elements_1.TesteeId) as TesteeId + minOrNull(elements_1.TesteeId) as TesteeId FROM ( SELECT diff --git a/ClickHouse.MySql.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..e9fbd7866dfb --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + avgOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.MySql.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..12e0aea29296 --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + minOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.MySql.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql.LinqService).sql index b79a4e3b3f20..9bf1c0cc4a18 100644 --- a/ClickHouse.MySql.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p.ParentID, p.Value1, - t1.COUNT_1 + t1.Count_1 FROM ( SELECT /* Inline */ c_1.ParentID as ParentID, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql.LinqService).sql index 2e516588f8c9..a14b84bc73f6 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - avg(c_1.ChildID), + avgOrNull(c_1.ChildID), AVG(c_1.ChildID), AVG(ALL c_1.ChildID), AVG(DISTINCT c_1.ChildID) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql.LinqService).sql index 7a5d56f1c0dc..f641b1b9c12a 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(c_1.ChildID), + maxOrNull(c_1.ChildID), MAX(c_1.ChildID), MAX(ALL c_1.ChildID), MAX(DISTINCT c_1.ChildID) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql.LinqService).sql index 4c2ef5c3fe9f..ee82235774ec 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - min(c_1.ChildID), + minOrNull(c_1.ChildID), MIN(c_1.ChildID), MIN(ALL c_1.ChildID), MIN(DISTINCT c_1.ChildID) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql.LinqService).sql index 870a67f0c194..b4e4a494f9a5 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql.LinqService).sql @@ -3,7 +3,7 @@ SELECT tt.Key_1, - sum(tt.ID) + sumOrNull(tt.ID) FROM ( SELECT @@ -25,5 +25,5 @@ FROM GROUP BY tt.Key_1 HAVING - sum(tt.ID) <> 0 + sumOrNull(tt.ID) <> 0 OR sumOrNull(tt.ID) IS NULL diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql.LinqService).sql index d10580fa18c8..96c790e00940 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - p.ID + toString(toUInt8(p.ID)) FROM LinqDataTypes p WHERE diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql.LinqService).sql index ee697760a73e..fb268183faf4 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql.LinqService).sql @@ -11,7 +11,7 @@ FROM Child g_1 GROUP BY g_1.ParentID - ) g_2 + ) t1 WHERE - g_2.ParentID > 2 + t1.ParentID > 2 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql.LinqService).sql index d04a7e5bf321..d25a1665298f 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql.LinqService).sql index 9703561f0311..cb2e40efad75 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql.LinqService).sql index 5236e1f0a338..df98e7878c75 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql.LinqService).sql @@ -3,7 +3,7 @@ SELECT COUNT(*), - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql.LinqService).sql index a4f6677ef4f4..3c4a991dc0f1 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.Key_1 < 5 + g_2.Count_1 > 2 AND g_2.Key_1 < 5 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql.LinqService).sql index edb7dc34dab1..0d8b29df1ed5 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2.Key_1 = 1 + g_2.Count_1 > 3 OR g_2.Key_1 = 1 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..5e13c216a69a --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e.Date DESC) as RowNumber, + e.Name as Name, + e.Date as Date_1, + e.Id as Id, + e.Group as Group_1, + e.Amount as Amount, + e.IsActive as IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = toInt64(1) +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.Name, + t1.Group, + t1.Date, + t1.Amount, + t1.IsActive +FROM + TestData t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql.LinqService).sql index a97a85f8b8c7..e9fd7c36ea88 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(Coalesce(a_Parent.Value1, 0)) + sumOrNull(Coalesce(a_Parent.Value1, 0)) FROM Child grp LEFT JOIN Parent a_Parent ON grp.ParentID = a_Parent.ParentID diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql.LinqService).sql index 5c6801231d96..6ef8176a7420 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql.LinqService).sql @@ -3,10 +3,10 @@ SELECT COUNT(*), - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID) + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql.LinqService).sql index 345a60cdcb74..ec692b7db519 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql.LinqService).sql @@ -2,10 +2,10 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID), + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID), COUNT(*) FROM Child g_1 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql.LinqService).sql index 6b4cb572bf0a..5573c6755945 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(c2.ChildID) + sumOrNull(c2.ChildID) FROM Child g_1 INNER JOIN Child c2 ON g_1.ChildID = c2.ChildID + 1 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..872d4b1ad33f --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,49 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t.GroupId, + COUNT(*), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t.DataValue), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT t.DataValue) +FROM + AggregationData t +WHERE + t.DataValue IS NOT NULL +GROUP BY + t.GroupId + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.GroupId, + t1.DataValue +FROM + AggregationData t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql.LinqService).sql index 9716e4197563..10ae3a7ead31 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql.LinqService).sql @@ -10,5 +10,5 @@ GROUP BY a_Parent.ParentID, a_Parent.Value1 HAVING - max(g_1.ParentID) > 2 + maxOrNull(g_1.ParentID) > 2 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql.LinqService).sql index a1f260b2bcef..0d130ff9a542 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent.ParentID as ParentID, - COUNT(*) as COUNT_1, + COUNT(*) as Count_1, a_Parent.Value1 as Value1 FROM GrandChild g_1 @@ -17,5 +17,5 @@ FROM a_Parent.Value1 ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.ParentID <> 1 + g_2.Count_1 > 2 AND g_2.ParentID <> 1 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql.LinqService).sql index 7a0781329d46..c92b9c6a7fa5 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql.LinqService).sql index 7a0781329d46..c92b9c6a7fa5 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql.LinqService).sql index 7be374e76344..d7a85f7d44d9 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM @@ -20,7 +20,7 @@ BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql.LinqService).sql index 2738fd6af267..4f144af8c4b2 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql.LinqService).sql @@ -3,7 +3,7 @@ SELECT t1.ChildID, - avg(t1.ParentID) + avgOrNull(t1.ParentID) FROM Child t1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql.LinqService).sql index 1abc3549044b..8c45d02e04bd 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql.LinqService).sql index cbe5f9b33bc7..3139e1131a62 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT ip.InvestorId, t1.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id @@ -12,7 +12,7 @@ FROM INNER JOIN PaymentCalculation pc ON ipd.CalculationId = pc.Id AND p.Id = pc.EventId INNER JOIN ( SELECT - sum(b.Units) as Units, + sumOrNull(b.Units) as Units, b.InvestorId as InvestorId, b.SecurityClass as SecurityClass FROM diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql.LinqService).sql index e3ade5d09c62..64a4d394e4d7 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql.LinqService).sql @@ -6,7 +6,7 @@ WITH CTE_1 AS SELECT g_1.InvestorId, g_1.SecurityClass, - sum(g_1.Units) as Units + sumOrNull(g_1.Units) as Units FROM Transaction g_1 GROUP BY @@ -16,7 +16,7 @@ WITH CTE_1 AS SELECT ip.InvestorId, b.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql.LinqService).sql index 980d01cdab0a..176ff36c26fc 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT t_1.FinalCustomerId, t_1.IsActive, - sum(t_1.Amount) + sumOrNull(t_1.Amount) FROM ( SELECT diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql.LinqService).sql index 6dcc96a45e51..9ddc719ff988 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql.LinqService).sql @@ -19,7 +19,7 @@ WHERE GROUP BY x.ParentID ORDER BY - max(x.ChildID) DESC + maxOrNull(x.ChildID) DESC LIMIT 2 ) t1 ) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql.LinqService).sql index bd29b57f0908..6eb96a25a1de 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql.LinqService).sql @@ -8,7 +8,7 @@ FROM Child ch INNER JOIN ( SELECT - max(max_1.ChildID) as c1 + maxOrNull(max_1.ChildID) as c1 FROM Child max_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql.LinqService).sql index becc7a89639c..7eb08e0a4518 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql.LinqService).sql @@ -8,7 +8,7 @@ FROM INNER JOIN ( SELECT t2.ID as ID, - max(t2.DateTimeValue) as c1 + maxOrNull(t2.DateTimeValue) as c1 FROM LinqDataTypes t2 WHERE diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql.LinqService).sql index d956efa8f7cd..75b3f50591bc 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql.LinqService).sql index 6579f0601c02..ebcf88bffb08 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql.LinqService).sql index 6d5b5944e21f..f5cff609f8e6 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql.LinqService).sql @@ -2,8 +2,8 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(g_1.ChildID), - max(g_1.ChildID + g_1.ParentID) + maxOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID + g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql.LinqService).sql index de5fa243d94e..0937c8f96322 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql.LinqService).sql @@ -2,23 +2,23 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - g_2.MIN_2 + g_2.Min_2 FROM ( SELECT minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1, + END) as Min_1, minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_2 + END) as Min_2 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2.Min_1 IS NOT NULL diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql.LinqService).sql index fec99c3d05ec..b9806181b703 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - g_2.MIN_1 + g_2.Min_1 FROM ( SELECT @@ -13,7 +13,7 @@ FROM minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1 + END) as Min_1 FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql.LinqService).sql index 5dfae579ede0..b3a1cac04120 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql.LinqService).sql index 560e22fb528c..afbee95a2cb9 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql.LinqService).sql index 560e22fb528c..afbee95a2cb9 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql.LinqService).sql index d956efa8f7cd..75b3f50591bc 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql.LinqService).sql index bc169b08e412..0a92ab09ad20 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql.LinqService).sql index bc169b08e412..0a92ab09ad20 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql.LinqService).sql index bc169b08e412..0a92ab09ad20 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql.LinqService).sql index ac796cf48115..8d7aea1b259b 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.n, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql.LinqService).sql index 2fb8da35284e..ada042eba36a 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 LEFT JOIN Parent p ON g_1.ParentID = p.ParentID diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql.LinqService).sql index 6a507febfe31..ad76e768a78d 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql.LinqService).sql index 6a507febfe31..ad76e768a78d 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql.LinqService).sql index 8d4cbfa71bb1..771517134dde 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - sum(g_2.ParentID - 3) + sumOrNull(g_2.ParentID - 3) FROM ( SELECT diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql.LinqService).sql index ecdfa40006b5..4ce0d18cb7c7 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql.LinqService).sql index ce0c3007b13a..eefba9f0ed03 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql.LinqService).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql.LinqService).sql index 208000de04f8..61ece512b7ab 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,1).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,1).sql index c6ff3af199fe..9c6b4dd6d7b2 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,1).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,2).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,2).sql index c6ff3af199fe..9c6b4dd6d7b2 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,2).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,1).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,1).sql index ce0c3007b13a..eefba9f0ed03 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,1).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,2).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,2).sql index ce0c3007b13a..eefba9f0ed03 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,2).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql.LinqService).sql index 32c49e329c27..00afc771c8ff 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql.LinqService).sql index ce0c3007b13a..eefba9f0ed03 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql.LinqService).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql.LinqService).sql index 208000de04f8..61ece512b7ab 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql.LinqService).sql index 6d26620ceeb1..ce13741592cc 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql.LinqService).sql index ecdfa40006b5..4ce0d18cb7c7 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql.LinqService).sql index 32c49e329c27..00afc771c8ff 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql.LinqService).sql index b945e3cb7430..fbfd0994ebaa 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue, 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue, 1) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql.LinqService).sql index f802ca6fae86..49ac2e835783 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql.LinqService).sql index f802ca6fae86..49ac2e835783 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql.LinqService).sql index 77c507157d7b..ada1c587d5d8 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql.LinqService).sql index 77c507157d7b..ada1c587d5d8 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql.LinqService).sql index ba5738a379e8..480c9066ae7a 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql.LinqService).sql @@ -17,7 +17,7 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1) + maxOrNull(x.OrderData1) LIMIT 0, 3 BeforeExecute @@ -39,6 +39,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - min(x.OrderData1) DESC + minOrNull(x.OrderData1) DESC LIMIT 0, 3 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql.LinqService).sql index 3ce1bf283fd2..f6aca0af68d3 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql.LinqService).sql @@ -17,6 +17,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1 % 3) + maxOrNull(x.OrderData1 % 3) LIMIT 0, 3 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql.LinqService).sql index 5e10a8cf44f2..a080e5b549fd 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql.LinqService).sql index 5e10a8cf44f2..a080e5b549fd 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql.LinqService).sql index 5e10a8cf44f2..a080e5b549fd 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql.LinqService).sql index 0336ba386580..415d3089e349 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql.LinqService).sql @@ -5,13 +5,13 @@ SELECT COUNT(*) OVER(), x.Key_1, x.Count_1, - x.MAX_1 + x.Max_1 FROM ( SELECT summary.LastName as Key_1, COUNT(*) as Count_1, - max(summary.FirstName) as MAX_1 + maxOrNull(summary.FirstName) as Max_1 FROM Person summary GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql.LinqService).sql index c1ac350d45c6..d1b4347d4139 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql.LinqService).sql @@ -10,7 +10,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 @@ -33,7 +33,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql.LinqService).sql index 5acd6dcd4ffb..d1c7bc4b6de0 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql.LinqService).sql @@ -8,7 +8,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - toInt64(1) as Index_1, p.FirstName as FirstName, p.LastName as LastName, p.PersonID as PersonID @@ -16,7 +16,7 @@ FROM Person p ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.PersonID DESC diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql.LinqService).sql index 0f130ec46897..0dbe3857e11a 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql.LinqService).sql @@ -7,7 +7,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - toInt64(1) as Index_1, g_2.Key_1 as Key_1 FROM ( @@ -20,7 +20,7 @@ FROM ) g_2 ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.Key_1 DESC diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..fc4b8a379dcf --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + Coalesce(t.Value2, '') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + Coalesce(t.Value3, '') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + arrayStringConcat([t.Value3, t.Value1, t.Value2], ' -> ') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + arrayStringConcat([t.Value3, t.Value3], ' -> ') +FROM + SampleClass t +ORDER BY + t.Id + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..9d72fac27be6 --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + arrayStringConcat([CASE + WHEN position(t.NullableValue, 'A') > 0 THEN t.NullableValue + ELSE NULL + END, CASE + WHEN position(t.NotNullableValue, 'A') > 0 THEN t.NotNullableValue + ELSE NULL + END, CASE + WHEN position(t.VarcharValue, 'A') > 0 THEN t.VarcharValue + ELSE NULL + END, CASE + WHEN position(t.NVarcharValue, 'A') > 0 THEN t.NVarcharValue + ELSE NULL + END], ', ') as c1 + FROM + SampleClass t + ) x +WHERE + NOT empty(replaceRegexpAll(coalesce(x.c1, ''), ' | +| | | | |…| | | | | | | | | | | | | |
|
| | ', '')) + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..45e2928ef03e --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((t1.NotNullableValue, toString(Coalesce(t1.NullableValue, '')))))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..c605c98c341f --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..c605c98c341f --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..b150469fbe46 --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(groupArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + arrayStringConcat(groupArray(toString(g_1.NotNullableValue)), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..06af8fe99260 --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupUniqArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL)))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupUniqArray((Coalesce(g_1.NullableValue, ''), toString(Coalesce(g_1.NullableValue, ''))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..8375e58bee37 --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((g_1.NullableValue, toString(Coalesce(g_1.NullableValue, '')))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.MySql.LinqService).sql new file mode 100644 index 000000000000..a4fbcb41e61d --- /dev/null +++ b/ClickHouse.MySql.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.MySql.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(groupUniqArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + Coalesce(arrayStringConcat(groupUniqArrayIf(toString(g_1.NullableValue), g_1.NullableValue IS NOT NULL), ', '), ''), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArrayIf((g_1.NullableValue, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))))), ', '), + arrayStringConcat(groupUniqArray(toString(g_1.NotNullableValue)), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArray((g_1.NotNullableValue, toString(g_1.NotNullableValue))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql.LinqService).sql index b8c11d0b9024..134115a23bb8 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql.LinqService).sql index b8c11d0b9024..134115a23bb8 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql.LinqService).sql index 6fa98f26de3c..126e60556fda 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(f.added) + maxOrNull(f.added) FROM activity649 f INNER JOIN person649 a_Person ON f.personid = a_Person.personid diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql.LinqService).sql index ef729c6cfd25..0a265ff567bc 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql.LinqService).sql @@ -4,7 +4,7 @@ SELECT data_1.ParentID, data_1.ChildID, - max(data_1.ChildID) + maxOrNull(data_1.ChildID) FROM Child data_1 GROUP BY diff --git a/ClickHouse.MySql.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql.LinqService).sql index 1bf378df9a65..5113e908d18c 100644 --- a/ClickHouse.MySql.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql.LinqService).sql @@ -2,12 +2,12 @@ -- ClickHouse.MySql ClickHouse (asynchronously) SELECT - g_1.COUNT_1 + g_1.Count_1 FROM ( SELECT c_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1.ParentID > 1 ) g_1 WHERE - g_1.Key_1 > 1 AND g_1.COUNT_1 > 1 + g_1.Key_1 > 1 AND g_1.Count_1 > 1 diff --git a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql.LinqService).sql index 107a167d79ea..25541c88797f 100644 --- a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql.LinqService).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql.LinqService).sql index a3b07410f637..60d27b3deda9 100644 --- a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql.LinqService).sql @@ -3,11 +3,11 @@ SELECT (toFloat64(COUNT(*)) * toFloat64(100)) / SUM(COUNT(*)) OVER(), - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 GROUP BY g_1.ParentID HAVING - sum(g_1.ParentID) <> 36 + sumOrNull(g_1.ParentID) <> 36 OR sumOrNull(g_1.ParentID) IS NULL diff --git a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql.LinqService).sql index 11d79d002bf9..b03feea56c9e 100644 --- a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql.LinqService).sql @@ -18,7 +18,7 @@ FROM vpc.CategoryId as CategoryId, pop.ProductId as ProductId, COALESCE(pcc.PeriodOrderLimit,0) as MaxCapacity, - COALESCE(COALESCE(vsp.SUM_1,0),0) as Quantity + COALESCE(COALESCE(vsp.Quantity,0),0) as Quantity FROM OrderPeriod op INNER JOIN ProductsPerOrderPeriod pop ON op.Id = pop.OrderPeriodId @@ -28,7 +28,7 @@ FROM SELECT agroup.Id as Id, oi.ProductId as ProductId, - sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as SUM_1 + sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as Quantity FROM OrderPeriod agroup LEFT JOIN OrderHeader oh ON agroup.Id = oh.PeriodId diff --git a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql.LinqService).sql b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql.LinqService).sql index f764e0f53d2c..ce1d8bf2c5c1 100644 --- a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql.LinqService).sql +++ b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql.LinqService).sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - min(elements_1.TesteeId) as TesteeId + minOrNull(elements_1.TesteeId) as TesteeId FROM ( SELECT diff --git a/ClickHouse.MySql/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.MySql).sql new file mode 100644 index 000000000000..57ec0f858b5d --- /dev/null +++ b/ClickHouse.MySql/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.MySql).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + avgOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.MySql/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.MySql).sql new file mode 100644 index 000000000000..ae5490b97918 --- /dev/null +++ b/ClickHouse.MySql/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.MySql).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + minOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.MySql/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql).sql index ee093361e665..e4523bfc5695 100644 --- a/ClickHouse.MySql/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.MySql).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p.ParentID, p.Value1, - t1.COUNT_1 + t1.Count_1 FROM ( SELECT /* Inline */ c_1.ParentID as ParentID, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql).sql index a3b563eac5bc..4a5f7c305811 100644 --- a/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - avg(c_1.ChildID), + avgOrNull(c_1.ChildID), AVG(c_1.ChildID), AVG(ALL c_1.ChildID), AVG(DISTINCT c_1.ChildID) diff --git a/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql).sql index a8d5ca45d8d8..2d5b05aeacac 100644 --- a/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(c_1.ChildID), + maxOrNull(c_1.ChildID), MAX(c_1.ChildID), MAX(ALL c_1.ChildID), MAX(DISTINCT c_1.ChildID) diff --git a/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql).sql index 64a6f5b810f3..5e57620c4d84 100644 --- a/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - min(c_1.ChildID), + minOrNull(c_1.ChildID), MIN(c_1.ChildID), MIN(ALL c_1.ChildID), MIN(DISTINCT c_1.ChildID) diff --git a/ClickHouse.MySql/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql).sql index fdc9ea257d58..57bb9ed36e2b 100644 --- a/ClickHouse.MySql/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.MySql).sql @@ -3,7 +3,7 @@ SELECT tt.Key_1, - sum(tt.ID) + sumOrNull(tt.ID) FROM ( SELECT @@ -25,5 +25,5 @@ FROM GROUP BY tt.Key_1 HAVING - sum(tt.ID) <> 0 + sumOrNull(tt.ID) <> 0 OR sumOrNull(tt.ID) IS NULL diff --git a/ClickHouse.MySql/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql).sql index 1179ca4c3df2..1f03cb9228d3 100644 --- a/ClickHouse.MySql/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - p.ID + toString(toUInt8(p.ID)) FROM LinqDataTypes p WHERE diff --git a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql).sql index 032341f7d561..fbbb3d32e97e 100644 --- a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.MySql).sql @@ -11,7 +11,7 @@ FROM Child g_1 GROUP BY g_1.ParentID - ) g_2 + ) t1 WHERE - g_2.ParentID > 2 + t1.ParentID > 2 diff --git a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql).sql index 72b7a5c0f0de..29dcb8ae2614 100644 --- a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.MySql).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql).sql index cf43970f6fff..c4c84a0b0269 100644 --- a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.MySql).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql).sql index 861f248f7b52..7737499aca30 100644 --- a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.MySql).sql @@ -3,7 +3,7 @@ SELECT COUNT(*), - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql).sql index 2ae8c95e0435..4800105fe8ea 100644 --- a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.MySql).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.Key_1 < 5 + g_2.Count_1 > 2 AND g_2.Key_1 < 5 diff --git a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql).sql index 35d00410f745..b4213784d5f6 100644 --- a/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.MySql).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2.Key_1 = 1 + g_2.Count_1 > 3 OR g_2.Key_1 = 1 diff --git a/ClickHouse.MySql/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.MySql).sql new file mode 100644 index 000000000000..4914b3333536 --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.MySql).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e.Date DESC) as RowNumber, + e.Name as Name, + e.Date as Date_1, + e.Id as Id, + e.Group as Group_1, + e.Amount as Amount, + e.IsActive as IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = toInt64(1) +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.Id, + t1.Name, + t1.Group, + t1.Date, + t1.Amount, + t1.IsActive +FROM + TestData t1 + diff --git a/ClickHouse.MySql/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.MySql).sql index 5ff2d56ad519..1903059c2362 100644 --- a/ClickHouse.MySql/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.MySql).sql @@ -3,10 +3,10 @@ SELECT m_2.MasterId, - d.Id1, - d.Id2, - d.Value, - d.ByteValues + t3.Id1, + t3.Id2, + t3.Value_1, + t3.ByteValues FROM ( SELECT DISTINCT @@ -23,7 +23,24 @@ FROM ) t1 INNER JOIN DetailClass dd ON t1.Id1 = dd.MasterId ) m_2 - INNER JOIN MasterClass d ON d.Id1 = m_2.MasterId + INNER JOIN ( + SELECT + t2.Id1 as Id1 + FROM + MasterClass t2 + GROUP BY + t2.Id1 + ) d ON d.Id1 = m_2.MasterId + INNER JOIN ( + SELECT + mm.Id1 as Id1, + mm.Id2 as Id2, + mm.Value as Value_1, + mm.ByteValues as ByteValues, + ROW_NUMBER() OVER (PARTITION BY mm.Id1 ORDER BY mm.Id1) as rn + FROM + MasterClass mm + ) t3 ON t3.Id1 = m_2.MasterId AND d.Id1 = t3.Id1 AND t3.rn <= 1 BeforeExecute -- ClickHouse.MySql ClickHouse diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql).sql index bfb3fc994f19..f61970c03555 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(Coalesce(a_Parent.Value1, 0)) + sumOrNull(Coalesce(a_Parent.Value1, 0)) FROM Child grp LEFT JOIN Parent a_Parent ON grp.ParentID = a_Parent.ParentID diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql).sql index 7cce0b5f7efb..27ade523200b 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.MySql).sql @@ -3,10 +3,10 @@ SELECT COUNT(*), - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID) + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql).sql index 78d3eb48f4b0..f6be7ed1ec2f 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.MySql).sql @@ -2,10 +2,10 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID), + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID), COUNT(*) FROM Child g_1 diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql).sql index 99b2e372eafb..dd54fdf3f378 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(c2.ChildID) + sumOrNull(c2.ChildID) FROM Child g_1 INNER JOIN Child c2 ON g_1.ChildID = c2.ChildID + 1 diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.MySql).sql new file mode 100644 index 000000000000..400b147c8e74 --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.MySql).sql @@ -0,0 +1,49 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t.GroupId, + COUNT(*), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t.DataValue), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT t.DataValue) +FROM + AggregationData t +WHERE + t.DataValue IS NOT NULL +GROUP BY + t.GroupId + +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.GroupId, + t1.DataValue +FROM + AggregationData t1 + diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql).sql index 2b726f2708c7..1916e8ed0fe8 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.MySql).sql @@ -10,5 +10,5 @@ GROUP BY a_Parent.ParentID, a_Parent.Value1 HAVING - max(g_1.ParentID) > 2 + maxOrNull(g_1.ParentID) > 2 diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql).sql index 29f566ad8b69..bea760bee29a 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.MySql).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent.ParentID as ParentID, - COUNT(*) as COUNT_1, + COUNT(*) as Count_1, a_Parent.Value1 as Value1 FROM GrandChild g_1 @@ -17,5 +17,5 @@ FROM a_Parent.Value1 ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.ParentID <> 1 + g_2.Count_1 > 2 AND g_2.ParentID <> 1 diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql).sql index 0be245dc078b..f3c3b4191fe1 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql).sql index 0be245dc078b..f3c3b4191fe1 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql).sql index 773e95a7ed4f..e0ebef4d2dff 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM @@ -20,7 +20,7 @@ BeforeExecute -- ClickHouse.MySql ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql).sql index dfeacd24cd63..f8bca44d20fa 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.MySql).sql @@ -3,7 +3,7 @@ SELECT t1.ChildID, - avg(t1.ParentID) + avgOrNull(t1.ParentID) FROM Child t1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql).sql index 9f6e2a59b44f..b6293507c007 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.MySql).sql index c99851326913..4226105d4dab 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT gr.FirstName, gr.LastName, - sum(gr.PersonID) + sumOrNull(gr.PersonID) FROM Person gr GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.MySql).sql index c99851326913..4226105d4dab 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT gr.FirstName, gr.LastName, - sum(gr.PersonID) + sumOrNull(gr.PersonID) FROM Person gr GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql).sql index b4cc3f791ed4..a9f64bc9bd3c 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT ip.InvestorId, t1.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id @@ -12,7 +12,7 @@ FROM INNER JOIN PaymentCalculation pc ON ipd.CalculationId = pc.Id AND p.Id = pc.EventId INNER JOIN ( SELECT - sum(b.Units) as Units, + sumOrNull(b.Units) as Units, b.InvestorId as InvestorId, b.SecurityClass as SecurityClass FROM diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql).sql index 3804e4c11a6d..2c83571dc82e 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.MySql).sql @@ -6,7 +6,7 @@ WITH CTE_1 AS SELECT g_1.InvestorId, g_1.SecurityClass, - sum(g_1.Units) as Units + sumOrNull(g_1.Units) as Units FROM Transaction g_1 GROUP BY @@ -16,7 +16,7 @@ WITH CTE_1 AS SELECT ip.InvestorId, b.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql).sql index f0626a22c38c..cf21835eab0a 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT t_1.FinalCustomerId, t_1.IsActive, - sum(t_1.Amount) + sumOrNull(t_1.Amount) FROM ( SELECT diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql).sql index a7ff9cc0d9c2..2f8033157a22 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.MySql).sql @@ -19,7 +19,7 @@ WHERE GROUP BY x.ParentID ORDER BY - max(x.ChildID) DESC + maxOrNull(x.ChildID) DESC LIMIT 2 ) t1 ) diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql).sql index 308dc042879d..1276cf35ac9c 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.MySql).sql @@ -8,7 +8,7 @@ FROM Child ch INNER JOIN ( SELECT - max(max_1.ChildID) as c1 + maxOrNull(max_1.ChildID) as c1 FROM Child max_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql).sql index 7f6c8a2ea1d6..9fb10eb98ad4 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.MySql).sql @@ -8,7 +8,7 @@ FROM INNER JOIN ( SELECT t2.ID as ID, - max(t2.DateTimeValue) as c1 + maxOrNull(t2.DateTimeValue) as c1 FROM LinqDataTypes t2 WHERE diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql).sql index e9f63c54166f..bb28c30ce28f 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql).sql index 1d522f6181d1..285971ea4122 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql).sql index b71d48f264a1..f090d8ea9989 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.MySql).sql @@ -2,8 +2,8 @@ -- ClickHouse.MySql ClickHouse SELECT - max(g_1.ChildID), - max(g_1.ChildID + g_1.ParentID) + maxOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID + g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql).sql index 7ffee94b5df2..5f5e67934ffb 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.MySql).sql @@ -2,23 +2,23 @@ -- ClickHouse.MySql ClickHouse SELECT - g_2.MIN_2 + g_2.Min_2 FROM ( SELECT minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1, + END) as Min_1, minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_2 + END) as Min_2 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2.Min_1 IS NOT NULL diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql).sql index 8b2949a7090e..a3f9f25b1049 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - g_2.MIN_1 + g_2.Min_1 FROM ( SELECT @@ -13,7 +13,7 @@ FROM minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1 + END) as Min_1 FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql).sql index 8ab2b6b9bd64..8db591ec2cad 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql).sql index 7e4902a16b30..ab9ccdfcab4d 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql).sql index 7e4902a16b30..ab9ccdfcab4d 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql).sql index e9f63c54166f..bb28c30ce28f 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql).sql index d7671a4ba4c2..db4ed805cd87 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.MySql).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql).sql index d7671a4ba4c2..db4ed805cd87 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.MySql).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql).sql index d7671a4ba4c2..db4ed805cd87 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.MySql).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql).sql index 5b9d3ad7732a..56d6fb499218 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.MySql).sql @@ -3,7 +3,7 @@ SELECT g_2.n, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql).sql index d69bca7aaff8..530eeaf6db57 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 LEFT JOIN Parent p ON g_1.ParentID = p.ParentID diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql).sql index eff990353c4f..bd05cd6ab996 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql).sql index eff990353c4f..bd05cd6ab996 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql).sql index 6e30e56ddd32..c5adcfbc0f6f 100644 --- a/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.MySql).sql @@ -2,7 +2,7 @@ -- ClickHouse.MySql ClickHouse SELECT - sum(g_2.ParentID - 3) + sumOrNull(g_2.ParentID - 3) FROM ( SELECT diff --git a/ClickHouse.MySql/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.MySql).sql index dd176be0014f..18ae8bd49863 100644 --- a/ClickHouse.MySql/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.MySql).sql @@ -12,7 +12,7 @@ BeforeExecute SELECT x_1.Key_1, - sum(x_1.MatchScore) + sumOrNull(x_1.MatchScore) FROM ( SELECT DISTINCT diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql).sql index 06873c583442..a75408b24ff0 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql).sql index fe30c2735242..6e00d1203f7f 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.MySql).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql).sql index dad6deddea4e..91de7de6e832 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,1).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,1).sql index c8a01f857d2e..fe1bc7a9caff 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,1).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,2).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,2).sql index c8a01f857d2e..fe1bc7a9caff 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,2).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,1).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,1).sql index fe30c2735242..6e00d1203f7f 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,1).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,2).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,2).sql index fe30c2735242..6e00d1203f7f 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,2).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.MySql,ToEven,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql).sql index 84b5404d7f54..f1e3a03c7f6b 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql).sql index fe30c2735242..6e00d1203f7f 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.MySql).sql @@ -2,12 +2,11 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql).sql index dad6deddea4e..91de7de6e832 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql).sql index 2a70db3aaaca..4099748a293c 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql).sql index 06873c583442..a75408b24ff0 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql).sql index 84b5404d7f54..f1e3a03c7f6b 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql).sql index cdba97208dd4..410662729c38 100644 --- a/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.MySql).sql @@ -2,9 +2,14 @@ -- ClickHouse.MySql ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue, 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue, 1) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql).sql index 53a4bbde9497..0b43fc4cd5a5 100644 --- a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.MySql).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.MySql ClickHouse @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql).sql index 53a4bbde9497..0b43fc4cd5a5 100644 --- a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.MySql).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.MySql ClickHouse @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql).sql index 4493d5327978..83509ff1301d 100644 --- a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.MySql).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql).sql index 4493d5327978..83509ff1301d 100644 --- a/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.MySql).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.MySql ClickHouse @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.MySql ClickHouse @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql).sql index ef7804bcba11..cf80a74f7ead 100644 --- a/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.MySql).sql @@ -17,7 +17,7 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1) + maxOrNull(x.OrderData1) LIMIT 0, 3 BeforeExecute @@ -39,6 +39,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - min(x.OrderData1) DESC + minOrNull(x.OrderData1) DESC LIMIT 0, 3 diff --git a/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql).sql index e5dd75693603..4ac717e3b0da 100644 --- a/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.MySql).sql @@ -17,6 +17,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1 % 3) + maxOrNull(x.OrderData1 % 3) LIMIT 0, 3 diff --git a/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql).sql index d88bfd929ef3..38b0fe3f2772 100644 --- a/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql).sql index d88bfd929ef3..38b0fe3f2772 100644 --- a/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql).sql index d88bfd929ef3..38b0fe3f2772 100644 --- a/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.MySql/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql).sql index f27cc429cb2b..16e95ae1ea7e 100644 --- a/ClickHouse.MySql/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.MySql).sql @@ -5,13 +5,13 @@ SELECT COUNT(*) OVER(), x.Key_1, x.Count_1, - x.MAX_1 + x.Max_1 FROM ( SELECT summary.LastName as Key_1, COUNT(*) as Count_1, - max(summary.FirstName) as MAX_1 + maxOrNull(summary.FirstName) as Max_1 FROM Person summary GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql).sql index dea1b32fa529..d8bf876d3678 100644 --- a/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.MySql).sql @@ -10,7 +10,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 @@ -33,7 +33,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 diff --git a/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql).sql index 07dc23331c5c..238b62e9b5a3 100644 --- a/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.MySql).sql @@ -8,7 +8,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - toInt64(1) as Index_1, p.FirstName as FirstName, p.LastName as LastName, p.PersonID as PersonID @@ -16,7 +16,7 @@ FROM Person p ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.PersonID DESC diff --git a/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql).sql index 7af7abb4a6cd..65c17646680c 100644 --- a/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.MySql).sql @@ -7,7 +7,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - toInt64(1) as Index_1, g_2.Key_1 as Key_1 FROM ( @@ -20,7 +20,7 @@ FROM ) g_2 ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.Key_1 DESC diff --git a/ClickHouse.MySql/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.MySql).sql index ea88e5402de1..ad8b1edc5c49 100644 --- a/ClickHouse.MySql/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.MySql).sql @@ -2,17 +2,21 @@ -- ClickHouse.MySql ClickHouse SELECT - arrayStringConcat([t.Value2], ' -> ') + Coalesce(t.Value2, '') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.MySql ClickHouse SELECT - arrayStringConcat([t.Value3], ' -> ') + Coalesce(t.Value3, '') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.MySql ClickHouse @@ -21,6 +25,8 @@ SELECT arrayStringConcat([t.Value3, t.Value1, t.Value2], ' -> ') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.MySql ClickHouse @@ -29,4 +35,6 @@ SELECT arrayStringConcat([t.Value3, t.Value3], ' -> ') FROM SampleClass t +ORDER BY + t.Id diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.MySql).sql new file mode 100644 index 000000000000..269a01cd8690 --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.MySql).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + x.c1 +FROM + ( + SELECT + arrayStringConcat([CASE + WHEN position(t.NullableValue, 'A') > 0 THEN t.NullableValue + ELSE NULL + END, CASE + WHEN position(t.NotNullableValue, 'A') > 0 THEN t.NotNullableValue + ELSE NULL + END, CASE + WHEN position(t.VarcharValue, 'A') > 0 THEN t.VarcharValue + ELSE NULL + END, CASE + WHEN position(t.NVarcharValue, 'A') > 0 THEN t.NVarcharValue + ELSE NULL + END], ', ') as c1 + FROM + SampleClass t + ) x +WHERE + NOT empty(replaceRegexpAll(coalesce(x.c1, ''), ' | +| | | | |…| | | | | | | | | | | | | |
|
| | ', '')) + +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.MySql).sql new file mode 100644 index 000000000000..53fb741f1a5a --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.MySql).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((t1.NotNullableValue, toString(Coalesce(t1.NullableValue, '')))))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.MySql).sql new file mode 100644 index 000000000000..c605c98c341f --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.MySql).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.MySql).sql new file mode 100644 index 000000000000..2bbd1a41eec2 --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.MySql).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.MySql).sql new file mode 100644 index 000000000000..8a98d96e394b --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.MySql).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(groupArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + arrayStringConcat(groupArray(toString(g_1.NotNullableValue)), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.MySql).sql new file mode 100644 index 000000000000..4a6eee5795fa --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.MySql).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupUniqArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL)))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupUniqArray((Coalesce(g_1.NullableValue, ''), toString(Coalesce(g_1.NullableValue, ''))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.MySql).sql new file mode 100644 index 000000000000..d8387a26bfea --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.MySql).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((g_1.NullableValue, toString(Coalesce(g_1.NullableValue, '')))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.MySql).sql new file mode 100644 index 000000000000..4d8208fbbd1e --- /dev/null +++ b/ClickHouse.MySql/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.MySql).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(groupUniqArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + Coalesce(arrayStringConcat(groupUniqArrayIf(toString(g_1.NullableValue), g_1.NullableValue IS NOT NULL), ', '), ''), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArrayIf((g_1.NullableValue, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))))), ', '), + arrayStringConcat(groupUniqArray(toString(g_1.NotNullableValue)), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArray((g_1.NotNullableValue, toString(g_1.NotNullableValue))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.MySql ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql).sql index 904b2443e888..f9ae258b3c08 100644 --- a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql).sql index 904b2443e888..f9ae258b3c08 100644 --- a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql).sql index 287fe3965336..e45d9a2e13a3 100644 --- a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(f.added) + maxOrNull(f.added) FROM activity649 f INNER JOIN person649 a_Person ON f.personid = a_Person.personid diff --git a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql).sql index 51ed3761aa01..348bd58863f3 100644 --- a/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT data_1.ParentID, data_1.ChildID, - max(data_1.ChildID) + maxOrNull(data_1.ChildID) FROM Child data_1 GROUP BY diff --git a/ClickHouse.MySql/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql).sql index 3d7243392773..5137952252cb 100644 --- a/ClickHouse.MySql/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.MySql).sql @@ -2,12 +2,12 @@ -- ClickHouse.MySql ClickHouse SELECT - g_1.COUNT_1 + g_1.Count_1 FROM ( SELECT c_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1.ParentID > 1 ) g_1 WHERE - g_1.Key_1 > 1 AND g_1.COUNT_1 > 1 + g_1.Key_1 > 1 AND g_1.Count_1 > 1 diff --git a/ClickHouse.MySql/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.MySql).sql index 8917d88a1061..50e850b8f41f 100644 --- a/ClickHouse.MySql/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.MySql).sql @@ -4,7 +4,7 @@ SELECT 'Title', it.Title, - sum(it.YearsExperience) + sumOrNull(it.YearsExperience) FROM odata_person it GROUP BY diff --git a/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql).sql index 5bd40da047f7..ac381d2e61ea 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.MySql).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.MySql).sql index 5bd40da047f7..ac381d2e61ea 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.MySql).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql).sql index 9a6fb88b5160..f1ef95b51867 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.MySql).sql @@ -3,11 +3,11 @@ SELECT (toFloat64(COUNT(*)) * toFloat64(100)) / SUM(COUNT(*)) OVER(), - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 GROUP BY g_1.ParentID HAVING - sum(g_1.ParentID) <> 36 + sumOrNull(g_1.ParentID) <> 36 OR sumOrNull(g_1.ParentID) IS NULL diff --git a/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.MySql).sql index e026358d5022..569800d0e0a1 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.MySql).sql @@ -7,17 +7,12 @@ SELECT d.ChildID FROM ( - SELECT DISTINCT - t2.ParentID as ParentID + SELECT + a_Parent.ParentID as ParentID FROM - ( - SELECT - a_Parent.ParentID as ParentID - FROM - Child t1 - LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID - LIMIT 1 - ) t2 + Child t1 + LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID + LIMIT 1 ) m_1 INNER JOIN Child d ON m_1.ParentID = d.ParentID diff --git a/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.MySql).sql index e026358d5022..569800d0e0a1 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.MySql).sql @@ -7,17 +7,12 @@ SELECT d.ChildID FROM ( - SELECT DISTINCT - t2.ParentID as ParentID + SELECT + a_Parent.ParentID as ParentID FROM - ( - SELECT - a_Parent.ParentID as ParentID - FROM - Child t1 - LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID - LIMIT 1 - ) t2 + Child t1 + LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID + LIMIT 1 ) m_1 INNER JOIN Child d ON m_1.ParentID = d.ParentID diff --git a/ClickHouse.MySql/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.MySql).sql index 49ab10ed5480..b15e9926946b 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.MySql).sql @@ -9,7 +9,7 @@ SELECT END, CASE WHEN i.SettlementTotalOnIssue IS NOT NULL THEN i.SettlementTotalOnIssue - WHEN ia.InvoiceID IS NOT NULL THEN ia.SUM_1 + WHEN ia.InvoiceId IS NOT NULL THEN ia.Total ELSE NULL END FROM @@ -17,8 +17,8 @@ FROM LEFT JOIN InvoiceReferenceNumber r ON r.InvoiceReferenceNumberID = i.InvoiceReferenceNumberID LEFT JOIN ( SELECT - g_1.InvoiceID as InvoiceID, - sum(ili.BillingAmountOverride) as SUM_1 + g_1.InvoiceID as InvoiceId, + sumOrNull(ili.BillingAmountOverride) as Total FROM Invoice g_1 INNER JOIN InvoiceLineItem ili ON ili.OwningInvoiceID = g_1.InvoiceID @@ -26,7 +26,7 @@ FROM NOT ili.Suppressed GROUP BY g_1.InvoiceID - ) ia ON ia.InvoiceID = i.InvoiceID + ) ia ON ia.InvoiceId = i.InvoiceID BeforeExecute -- ClickHouse.MySql ClickHouse @@ -52,7 +52,7 @@ SELECT ELSE r.ReferenceNumber END, CASE - WHEN ia.InvoiceID IS NOT NULL THEN ia.SUM_1 + WHEN ia.InvoiceId IS NOT NULL THEN ia.Total ELSE NULL END FROM @@ -60,8 +60,8 @@ FROM LEFT JOIN InvoiceReferenceNumber r ON r.InvoiceReferenceNumberID = i.InvoiceReferenceNumberID LEFT JOIN ( SELECT - g_1.InvoiceID as InvoiceID, - sum(ili.BillingAmountOverride) as SUM_1 + g_1.InvoiceID as InvoiceId, + sumOrNull(ili.BillingAmountOverride) as Total FROM Invoice g_1 INNER JOIN InvoiceLineItem ili ON ili.OwningInvoiceID = g_1.InvoiceID @@ -69,5 +69,5 @@ FROM NOT ili.Suppressed GROUP BY g_1.InvoiceID - ) ia ON ia.InvoiceID = i.InvoiceID + ) ia ON ia.InvoiceId = i.InvoiceID diff --git a/ClickHouse.MySql/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.MySql).sql index 82c27dd71a2b..cac8a3855d13 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.MySql).sql @@ -2,7 +2,11 @@ -- ClickHouse.MySql ClickHouse SELECT - concat('Issue1977Table/', toString(f.firstField), '/', toString(f.secondField)) = arrayStringConcat(['Issue1977Table', toString(f.firstField), toString(f.secondField)], '/') + CASE + WHEN concat('Issue1977Table/', toString(f.firstField), '/', toString(f.secondField)) = arrayStringConcat(['Issue1977Table', toString(f.firstField), toString(f.secondField)], '/') + THEN true + ELSE false + END FROM Issue1977Table f diff --git a/ClickHouse.MySql/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql).sql index eded1bd22ddd..9c87abb3d252 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.MySql).sql @@ -18,7 +18,7 @@ FROM vpc.CategoryId as CategoryId, pop.ProductId as ProductId, COALESCE(pcc.PeriodOrderLimit,0) as MaxCapacity, - COALESCE(COALESCE(vsp.SUM_1,0),0) as Quantity + COALESCE(COALESCE(vsp.Quantity,0),0) as Quantity FROM OrderPeriod op INNER JOIN ProductsPerOrderPeriod pop ON op.Id = pop.OrderPeriodId @@ -28,7 +28,7 @@ FROM SELECT agroup.Id as Id, oi.ProductId as ProductId, - sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as SUM_1 + sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as Quantity FROM OrderPeriod agroup LEFT JOIN OrderHeader oh ON agroup.Id = oh.PeriodId diff --git a/ClickHouse.MySql/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql).sql b/ClickHouse.MySql/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql).sql index 36464e33afe4..98e780bbe94c 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.MySql).sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - min(elements_1.TesteeId) as TesteeId + minOrNull(elements_1.TesteeId) as TesteeId FROM ( SELECT diff --git a/ClickHouse.Octonica.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..02dfc41d5c61 --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + avgOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..ec6a70d5246c --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + minOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica.LinqService).sql index a69d00d7ef60..ded3db7654f0 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p.ParentID, p.Value1, - t1.COUNT_1 + t1.Count_1 FROM ( SELECT /* Inline */ c_1.ParentID as ParentID, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica.LinqService).sql index cbfa23a27830..18428770edbf 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - avg(c_1.ChildID), + avgOrNull(c_1.ChildID), AVG(c_1.ChildID), AVG(ALL c_1.ChildID), AVG(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica.LinqService).sql index ed117fb7458f..90df7f59ee8e 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(c_1.ChildID), + maxOrNull(c_1.ChildID), MAX(c_1.ChildID), MAX(ALL c_1.ChildID), MAX(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica.LinqService).sql index f806ac389056..e0118a1ca345 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - min(c_1.ChildID), + minOrNull(c_1.ChildID), MIN(c_1.ChildID), MIN(ALL c_1.ChildID), MIN(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica.LinqService).sql index f79dd7067151..d48603b5b296 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica.LinqService).sql @@ -3,7 +3,7 @@ SELECT tt.Key_1, - sum(tt.ID) + sumOrNull(tt.ID) FROM ( SELECT @@ -25,5 +25,5 @@ FROM GROUP BY tt.Key_1 HAVING - sum(tt.ID) <> 0 + sumOrNull(tt.ID) <> 0 OR sumOrNull(tt.ID) IS NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica.LinqService).sql index c3f04bec3ca6..6d58c53d8cc4 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - p.ID + toString(toUInt8(p.ID)) FROM LinqDataTypes p WHERE diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica.LinqService).sql index c3dffa2d615b..4e7de7b7bb77 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica.LinqService).sql @@ -11,7 +11,7 @@ FROM Child g_1 GROUP BY g_1.ParentID - ) g_2 + ) t1 WHERE - g_2.ParentID > 2 + t1.ParentID > 2 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica.LinqService).sql index 7253cb688fbe..89d9a9d05cc7 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica.LinqService).sql index ead26abcbc47..ea1b977a9218 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica.LinqService).sql index 099995aecea6..27aafea6d941 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica.LinqService).sql @@ -3,7 +3,7 @@ SELECT COUNT(*), - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica.LinqService).sql index cb3bf2c502db..18b1190bc342 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.Key_1 < 5 + g_2.Count_1 > 2 AND g_2.Key_1 < 5 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica.LinqService).sql index b7ecce5f3f1a..4dec2b2f8e8a 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2.Key_1 = 1 + g_2.Count_1 > 3 OR g_2.Key_1 = 1 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..0e855c1f703c --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e.Date DESC) as RowNumber, + e.Name as Name, + e.Date as Date_1, + e.Id as Id, + e.Group as Group_1, + e.Amount as Amount, + e.IsActive as IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = toInt64(1) +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.Name, + t1.Group, + t1.Date, + t1.Amount, + t1.IsActive +FROM + TestData t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica.LinqService).sql index 9ce0a977a7ef..74f9f12f6281 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(Coalesce(a_Parent.Value1, 0)) + sumOrNull(Coalesce(a_Parent.Value1, 0)) FROM Child grp LEFT JOIN Parent a_Parent ON grp.ParentID = a_Parent.ParentID diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica.LinqService).sql index ee91067fa735..2d9fccea8500 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica.LinqService).sql @@ -3,10 +3,10 @@ SELECT COUNT(*), - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID) + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica.LinqService).sql index 9adc783c4cce..70c4ccf05907 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica.LinqService).sql @@ -2,10 +2,10 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID), + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID), COUNT(*) FROM Child g_1 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica.LinqService).sql index 7b0be7c27c10..2b64914ae39f 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(c2.ChildID) + sumOrNull(c2.ChildID) FROM Child g_1 INNER JOIN Child c2 ON g_1.ChildID = c2.ChildID + 1 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..cd1878d6c5c0 --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,49 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t.GroupId, + COUNT(*), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t.DataValue), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT t.DataValue) +FROM + AggregationData t +WHERE + t.DataValue IS NOT NULL +GROUP BY + t.GroupId + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.GroupId, + t1.DataValue +FROM + AggregationData t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica.LinqService).sql index 502fb13eb678..a5a5013904bb 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica.LinqService).sql @@ -10,5 +10,5 @@ GROUP BY a_Parent.ParentID, a_Parent.Value1 HAVING - max(g_1.ParentID) > 2 + maxOrNull(g_1.ParentID) > 2 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica.LinqService).sql index 11d50c858094..561ae92b02e3 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent.ParentID as ParentID, - COUNT(*) as COUNT_1, + COUNT(*) as Count_1, a_Parent.Value1 as Value1 FROM GrandChild g_1 @@ -17,5 +17,5 @@ FROM a_Parent.Value1 ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.ParentID <> 1 + g_2.Count_1 > 2 AND g_2.ParentID <> 1 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica.LinqService).sql index aeb1a247edb1..3beb852208f7 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica.LinqService).sql index aeb1a247edb1..3beb852208f7 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica.LinqService).sql index 905ae22bdebb..513b6bff11ed 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM @@ -20,7 +20,7 @@ BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica.LinqService).sql index 02c4cfbcb7ad..e6b253aac152 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica.LinqService).sql @@ -3,7 +3,7 @@ SELECT t1.ChildID, - avg(t1.ParentID) + avgOrNull(t1.ParentID) FROM Child t1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica.LinqService).sql index 28e299f68f72..ea24388f490a 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica.LinqService).sql index e8102a15e56f..f885a612d1e0 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT ip.InvestorId, t1.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id @@ -12,7 +12,7 @@ FROM INNER JOIN PaymentCalculation pc ON ipd.CalculationId = pc.Id AND p.Id = pc.EventId INNER JOIN ( SELECT - sum(b.Units) as Units, + sumOrNull(b.Units) as Units, b.InvestorId as InvestorId, b.SecurityClass as SecurityClass FROM diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica.LinqService).sql index a458c2b70616..35f380a60676 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica.LinqService).sql @@ -6,7 +6,7 @@ WITH CTE_1 AS SELECT g_1.InvestorId, g_1.SecurityClass, - sum(g_1.Units) as Units + sumOrNull(g_1.Units) as Units FROM Transaction g_1 GROUP BY @@ -16,7 +16,7 @@ WITH CTE_1 AS SELECT ip.InvestorId, b.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica.LinqService).sql index e427d9ea1768..417d5c2e30e0 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT t_1.FinalCustomerId, t_1.IsActive, - sum(t_1.Amount) + sumOrNull(t_1.Amount) FROM ( SELECT diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica.LinqService).sql index 4d8db9ca39c1..9dbf4c7097a2 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica.LinqService).sql @@ -19,7 +19,7 @@ WHERE GROUP BY x.ParentID ORDER BY - max(x.ChildID) DESC + maxOrNull(x.ChildID) DESC LIMIT 2 ) t1 ) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica.LinqService).sql index 952bb8743a88..40c0a5a869c1 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica.LinqService).sql @@ -8,7 +8,7 @@ FROM Child ch INNER JOIN ( SELECT - max(max_1.ChildID) as c1 + maxOrNull(max_1.ChildID) as c1 FROM Child max_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica.LinqService).sql index f0774c43434f..0539e9b0f731 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica.LinqService).sql @@ -8,7 +8,7 @@ FROM INNER JOIN ( SELECT t2.ID as ID, - max(t2.DateTimeValue) as c1 + maxOrNull(t2.DateTimeValue) as c1 FROM LinqDataTypes t2 WHERE diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica.LinqService).sql index a8f8ac85b9be..1468fd721d94 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica.LinqService).sql index c582ab064e0f..93c99b45a300 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica.LinqService).sql index ed3568d231a1..f426bff30edd 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica.LinqService).sql @@ -2,8 +2,8 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(g_1.ChildID), - max(g_1.ChildID + g_1.ParentID) + maxOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID + g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica.LinqService).sql index f762d8914e5e..0386f3d29e0d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica.LinqService).sql @@ -2,23 +2,23 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - g_2.MIN_2 + g_2.Min_2 FROM ( SELECT minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1, + END) as Min_1, minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_2 + END) as Min_2 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2.Min_1 IS NOT NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica.LinqService).sql index 4697d46b0ad3..4d97062d297f 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - g_2.MIN_1 + g_2.Min_1 FROM ( SELECT @@ -13,7 +13,7 @@ FROM minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1 + END) as Min_1 FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica.LinqService).sql index 9a453e8e04b9..f5bedc423b6f 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica.LinqService).sql index 0314e2599533..73b469b0a155 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica.LinqService).sql index 0314e2599533..73b469b0a155 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica.LinqService).sql index a8f8ac85b9be..1468fd721d94 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica.LinqService).sql index 2a8b6e8c35e6..46265f1b0cfb 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica.LinqService).sql index 2a8b6e8c35e6..46265f1b0cfb 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica.LinqService).sql index 2a8b6e8c35e6..46265f1b0cfb 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica.LinqService).sql index dfcb2f3e5689..ce6a741af526 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica.LinqService).sql @@ -3,7 +3,7 @@ SELECT g_2.n, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica.LinqService).sql index 38f92402fdc1..1e17ac881ed8 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 LEFT JOIN Parent p ON g_1.ParentID = p.ParentID diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica.LinqService).sql index 984030d3f29d..8ddc5d6e7a8b 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica.LinqService).sql index 984030d3f29d..8ddc5d6e7a8b 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica.LinqService).sql index 646801764936..02337915b9f6 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica.LinqService).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - sum(g_2.ParentID - 3) + sumOrNull(g_2.ParentID - 3) FROM ( SELECT diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica.LinqService).sql index c78d42a4f692..e1d1ffbfcdc7 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica.LinqService).sql index 21df267043f8..a8ac7482799d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica.LinqService).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica.LinqService).sql index 00dcf08da6d3..dbfef92cb35d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,1).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,1).sql index 6780e2491d98..43652a4ee307 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,1).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,2).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,2).sql index 6780e2491d98..43652a4ee307 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,2).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,1).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,1).sql index 21df267043f8..a8ac7482799d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,1).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,2).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,2).sql index 21df267043f8..a8ac7482799d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,2).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica.LinqService).sql index f288d0a98e90..77ac7139c593 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica.LinqService).sql index 21df267043f8..a8ac7482799d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica.LinqService).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica.LinqService).sql index 00dcf08da6d3..dbfef92cb35d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica.LinqService).sql index 003df1e492b3..bcb4a46b36d9 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica.LinqService).sql index c78d42a4f692..e1d1ffbfcdc7 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica.LinqService).sql index f288d0a98e90..77ac7139c593 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica.LinqService).sql index 8fb351b072b4..e6e912f42f47 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica.LinqService).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue, 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue, 1) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica.LinqService).sql index ba4d1031246e..ebd92e4928f2 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica.LinqService).sql index ba4d1031246e..ebd92e4928f2 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica.LinqService).sql index cad0b64c6562..aa5361b2b11b 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica.LinqService).sql index cad0b64c6562..aa5361b2b11b 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica.LinqService).sql index abc59514e562..2ecf75dcf051 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica.LinqService).sql @@ -17,7 +17,7 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1) + maxOrNull(x.OrderData1) LIMIT 0, 3 BeforeExecute @@ -39,6 +39,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - min(x.OrderData1) DESC + minOrNull(x.OrderData1) DESC LIMIT 0, 3 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica.LinqService).sql index 2fc6fc2166a5..c17f7225fb64 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica.LinqService).sql @@ -17,6 +17,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1 % 3) + maxOrNull(x.OrderData1 % 3) LIMIT 0, 3 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica.LinqService).sql index 19e5f29dc617..ddaceb0538b5 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica.LinqService).sql index 19e5f29dc617..ddaceb0538b5 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica.LinqService).sql index 19e5f29dc617..ddaceb0538b5 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica.LinqService).sql index 24b966adcf35..90b692627722 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica.LinqService).sql @@ -5,13 +5,13 @@ SELECT COUNT(*) OVER(), x.Key_1, x.Count_1, - x.MAX_1 + x.Max_1 FROM ( SELECT summary.LastName as Key_1, COUNT(*) as Count_1, - max(summary.FirstName) as MAX_1 + maxOrNull(summary.FirstName) as Max_1 FROM Person summary GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica.LinqService).sql index f318c1b2f83f..7c64fc5ca697 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica.LinqService).sql @@ -10,7 +10,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 @@ -33,7 +33,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica.LinqService).sql index 0479719d58d0..b6bc24836d7d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica.LinqService).sql @@ -8,7 +8,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - toInt64(1) as Index_1, p.FirstName as FirstName, p.LastName as LastName, p.PersonID as PersonID @@ -16,7 +16,7 @@ FROM Person p ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.PersonID DESC diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica.LinqService).sql index 3b7ef51bdfa1..8c35439ea0d5 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica.LinqService).sql @@ -7,7 +7,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - toInt64(1) as Index_1, g_2.Key_1 as Key_1 FROM ( @@ -20,7 +20,7 @@ FROM ) g_2 ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.Key_1 DESC diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..e56e2b27fb7b --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + Coalesce(t.Value2, '') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + Coalesce(t.Value3, '') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + arrayStringConcat([t.Value3, t.Value1, t.Value2], ' -> ') +FROM + SampleClass t +ORDER BY + t.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + arrayStringConcat([t.Value3, t.Value3], ' -> ') +FROM + SampleClass t +ORDER BY + t.Id + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..6bf94abbb937 --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + arrayStringConcat([CASE + WHEN position(t.NullableValue, 'A') > 0 THEN t.NullableValue + ELSE NULL + END, CASE + WHEN position(t.NotNullableValue, 'A') > 0 THEN t.NotNullableValue + ELSE NULL + END, CASE + WHEN position(t.VarcharValue, 'A') > 0 THEN t.VarcharValue + ELSE NULL + END, CASE + WHEN position(t.NVarcharValue, 'A') > 0 THEN t.NVarcharValue + ELSE NULL + END], ', ') as c1 + FROM + SampleClass t + ) x +WHERE + NOT empty(replaceRegexpAll(coalesce(x.c1, ''), ' | +| | | | |…| | | | | | | | | | | | | |
|
| | ', '')) + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..ed1dd815a48d --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((t1.NotNullableValue, toString(Coalesce(t1.NullableValue, '')))))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..0054e5f621c2 --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..0054e5f621c2 --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..aec4a4624f8d --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(groupArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + arrayStringConcat(groupArray(toString(g_1.NotNullableValue)), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..c9905aa59c1b --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupUniqArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL)))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupUniqArray((Coalesce(g_1.NullableValue, ''), toString(Coalesce(g_1.NullableValue, ''))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..b3879cb29806 --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((g_1.NullableValue, toString(Coalesce(g_1.NullableValue, '')))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Octonica.LinqService).sql new file mode 100644 index 000000000000..1f6163810701 --- /dev/null +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Octonica.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + g_1.Id, + arrayStringConcat(groupUniqArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + Coalesce(arrayStringConcat(groupUniqArrayIf(toString(g_1.NullableValue), g_1.NullableValue IS NOT NULL), ', '), ''), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArrayIf((g_1.NullableValue, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))))), ', '), + arrayStringConcat(groupUniqArray(toString(g_1.NotNullableValue)), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArray((g_1.NotNullableValue, toString(g_1.NotNullableValue))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica.LinqService).sql index 171c945f5b0b..602bbf65698f 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica.LinqService).sql index 171c945f5b0b..602bbf65698f 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica.LinqService).sql index 10631308ba70..e5c1445e9edf 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(f.added) + maxOrNull(f.added) FROM activity649 f INNER JOIN person649 a_Person ON f.personid = a_Person.personid diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica.LinqService).sql index 8621114955c6..ac5ec4af35d4 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica.LinqService).sql @@ -4,7 +4,7 @@ SELECT data_1.ParentID, data_1.ChildID, - max(data_1.ChildID) + maxOrNull(data_1.ChildID) FROM Child data_1 GROUP BY diff --git a/ClickHouse.Octonica.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica.LinqService).sql index c0011ea9019f..85623c16b917 100644 --- a/ClickHouse.Octonica.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica.LinqService).sql @@ -2,12 +2,12 @@ -- ClickHouse.Octonica ClickHouse (asynchronously) SELECT - g_1.COUNT_1 + g_1.Count_1 FROM ( SELECT c_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1.ParentID > 1 ) g_1 WHERE - g_1.Key_1 > 1 AND g_1.COUNT_1 > 1 + g_1.Key_1 > 1 AND g_1.Count_1 > 1 diff --git a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica.LinqService).sql index 1aff59a33275..0fb6a0946218 100644 --- a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica.LinqService).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica.LinqService).sql index d99e237ab3c5..4296ae12323a 100644 --- a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica.LinqService).sql @@ -3,11 +3,11 @@ SELECT (toFloat64(COUNT(*)) * toFloat64(100)) / SUM(COUNT(*)) OVER(), - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 GROUP BY g_1.ParentID HAVING - sum(g_1.ParentID) <> 36 + sumOrNull(g_1.ParentID) <> 36 OR sumOrNull(g_1.ParentID) IS NULL diff --git a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica.LinqService).sql index ffa284d68bc8..93e52a0e137a 100644 --- a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica.LinqService).sql @@ -18,7 +18,7 @@ FROM vpc.CategoryId as CategoryId, pop.ProductId as ProductId, COALESCE(pcc.PeriodOrderLimit,0) as MaxCapacity, - COALESCE(COALESCE(vsp.SUM_1,0),0) as Quantity + COALESCE(COALESCE(vsp.Quantity,0),0) as Quantity FROM OrderPeriod op INNER JOIN ProductsPerOrderPeriod pop ON op.Id = pop.OrderPeriodId @@ -28,7 +28,7 @@ FROM SELECT agroup.Id as Id, oi.ProductId as ProductId, - sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as SUM_1 + sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as Quantity FROM OrderPeriod agroup LEFT JOIN OrderHeader oh ON agroup.Id = oh.PeriodId diff --git a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica.LinqService).sql b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica.LinqService).sql index c323f6f5f73d..293935553dcd 100644 --- a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica.LinqService).sql +++ b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica.LinqService).sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - min(elements_1.TesteeId) as TesteeId + minOrNull(elements_1.TesteeId) as TesteeId FROM ( SELECT diff --git a/ClickHouse.Octonica/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..88f7b4bf510e --- /dev/null +++ b/ClickHouse.Octonica/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(ClickHouse.Octonica).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + avgOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Octonica/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..798929638025 --- /dev/null +++ b/ClickHouse.Octonica/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(ClickHouse.Octonica).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + minOrNull(t1.ParentID) +FROM + Parent t1 +WHERE + t1.ParentID < 0 + diff --git a/ClickHouse.Octonica/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica).sql index 9ef1f7b83626..e3f251449507 100644 --- a/ClickHouse.Octonica/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(ClickHouse.Octonica).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p.ParentID, p.Value1, - t1.COUNT_1 + t1.Count_1 FROM ( SELECT /* Inline */ c_1.ParentID as ParentID, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica).sql index 83ff6e4116c3..cee1b2be8a20 100644 --- a/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestAvg(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - avg(c_1.ChildID), + avgOrNull(c_1.ChildID), AVG(c_1.ChildID), AVG(ALL c_1.ChildID), AVG(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica).sql index a464b4eff5fa..ed20cd20514b 100644 --- a/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMax(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(c_1.ChildID), + maxOrNull(c_1.ChildID), MAX(c_1.ChildID), MAX(ALL c_1.ChildID), MAX(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica).sql index 974ef20e3151..ab3a80f90f28 100644 --- a/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.TestMin(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - min(c_1.ChildID), + minOrNull(c_1.ChildID), MIN(c_1.ChildID), MIN(ALL c_1.ChildID), MIN(DISTINCT c_1.ChildID) diff --git a/ClickHouse.Octonica/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica).sql index 1b8a4c1b5a6b..aa3f57b158bd 100644 --- a/ClickHouse.Octonica/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(ClickHouse.Octonica).sql @@ -3,7 +3,7 @@ SELECT tt.Key_1, - sum(tt.ID) + sumOrNull(tt.ID) FROM ( SELECT @@ -25,5 +25,5 @@ FROM GROUP BY tt.Key_1 HAVING - sum(tt.ID) <> 0 + sumOrNull(tt.ID) <> 0 OR sumOrNull(tt.ID) IS NULL diff --git a/ClickHouse.Octonica/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica).sql index 47343542e3c0..040b64238cee 100644 --- a/ClickHouse.Octonica/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - p.ID + toString(toUInt8(p.ID)) FROM LinqDataTypes p WHERE diff --git a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica).sql index 82e1f67db1a1..71dfd6f0b191 100644 --- a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(ClickHouse.Octonica).sql @@ -11,7 +11,7 @@ FROM Child g_1 GROUP BY g_1.ParentID - ) g_2 + ) t1 WHERE - g_2.ParentID > 2 + t1.ParentID > 2 diff --git a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica).sql index f99442e467eb..b13708347491 100644 --- a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(ClickHouse.Octonica).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica).sql index 921ffc84c9ab..a1b32b63bab3 100644 --- a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(ClickHouse.Octonica).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - Child p - INNER JOIN Parent a_Parent ON p.ParentID = a_Parent.ParentID + Child ch + INNER JOIN Parent a_Parent ON ch.ParentID = a_Parent.ParentID WHERE a_Parent.ParentID = 1 diff --git a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica).sql index 648ff2ce0e4f..453ba055b4ad 100644 --- a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(ClickHouse.Octonica).sql @@ -3,7 +3,7 @@ SELECT COUNT(*), - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica).sql index 4ae02b78d4a9..b2d1d6616d62 100644 --- a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(ClickHouse.Octonica).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.Key_1 < 5 + g_2.Count_1 > 2 AND g_2.Key_1 < 5 diff --git a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica).sql index b41ae99cf09d..10f4f1ceb090 100644 --- a/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(ClickHouse.Octonica).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2.Key_1 = 1 + g_2.Count_1 > 3 OR g_2.Key_1 = 1 diff --git a/ClickHouse.Octonica/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..1892ef336ec9 --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(ClickHouse.Octonica).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.Id, + t1.Name, + t1.Group_1, + t1.Date_1, + t1.Amount, + t1.IsActive +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e.Id, e.Name ORDER BY e.Name, e.Date DESC) as RowNumber, + e.Name as Name, + e.Date as Date_1, + e.Id as Id, + e.Group as Group_1, + e.Amount as Amount, + e.IsActive as IsActive + FROM + TestData e + ) t1 +WHERE + t1.RowNumber = toInt64(1) +ORDER BY + t1.Name, + t1.Date_1 DESC + +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.Id, + t1.Name, + t1.Group, + t1.Date, + t1.Amount, + t1.IsActive +FROM + TestData t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Octonica).sql index ac86d8bd4507..0a7eca4abda6 100644 --- a/ClickHouse.Octonica/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(ClickHouse.Octonica).sql @@ -3,10 +3,10 @@ SELECT m_2.MasterId, - d.Id1, - d.Id2, - d.Value, - d.ByteValues + t3.Id1, + t3.Id2, + t3.Value_1, + t3.ByteValues FROM ( SELECT DISTINCT @@ -23,7 +23,24 @@ FROM ) t1 INNER JOIN DetailClass dd ON t1.Id1 = dd.MasterId ) m_2 - INNER JOIN MasterClass d ON d.Id1 = m_2.MasterId + INNER JOIN ( + SELECT + t2.Id1 as Id1 + FROM + MasterClass t2 + GROUP BY + t2.Id1 + ) d ON d.Id1 = m_2.MasterId + INNER JOIN ( + SELECT + mm.Id1 as Id1, + mm.Id2 as Id2, + mm.Value as Value_1, + mm.ByteValues as ByteValues, + ROW_NUMBER() OVER (PARTITION BY mm.Id1 ORDER BY mm.Id1) as rn + FROM + MasterClass mm + ) t3 ON t3.Id1 = m_2.MasterId AND d.Id1 = t3.Id1 AND t3.rn <= 1 BeforeExecute -- ClickHouse.Octonica ClickHouse diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica).sql index d1d0c64a6ccd..a2713d1a8148 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(Coalesce(a_Parent.Value1, 0)) + sumOrNull(Coalesce(a_Parent.Value1, 0)) FROM Child grp LEFT JOIN Parent a_Parent ON grp.ParentID = a_Parent.ParentID diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica).sql index f7837066369a..40d3691a0372 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(ClickHouse.Octonica).sql @@ -3,10 +3,10 @@ SELECT COUNT(*), - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID) + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica).sql index 408776db1b8c..56e96e243a0e 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(ClickHouse.Octonica).sql @@ -2,10 +2,10 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(g_1.ChildID), - min(g_1.ChildID), - max(g_1.ChildID), - avg(g_1.ChildID), + sumOrNull(g_1.ChildID), + minOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID), + avgOrNull(g_1.ChildID), COUNT(*) FROM Child g_1 diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica).sql index 4afe177b21ff..cbc7a292b4fa 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(c2.ChildID) + sumOrNull(c2.ChildID) FROM Child g_1 INNER JOIN Child c2 ON g_1.ChildID = c2.ChildID + 1 diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..1a16372a4686 --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(ClickHouse.Octonica).sql @@ -0,0 +1,49 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t.GroupId, + COUNT(*), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t.DataValue), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN t.DataValue % 2 = toFloat64(0) THEN t.DataValue + ELSE NULL + END), + COUNT(DISTINCT t.DataValue) +FROM + AggregationData t +WHERE + t.DataValue IS NOT NULL +GROUP BY + t.GroupId + +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.GroupId, + t1.DataValue +FROM + AggregationData t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica).sql index eec7f598323f..98a0f07822a1 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation101(ClickHouse.Octonica).sql @@ -10,5 +10,5 @@ GROUP BY a_Parent.ParentID, a_Parent.Value1 HAVING - max(g_1.ParentID) > 2 + maxOrNull(g_1.ParentID) > 2 diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica).sql index 7aa3fee84c94..a506f8caed1e 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(ClickHouse.Octonica).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent.ParentID as ParentID, - COUNT(*) as COUNT_1, + COUNT(*) as Count_1, a_Parent.Value1 as Value1 FROM GrandChild g_1 @@ -17,5 +17,5 @@ FROM a_Parent.Value1 ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2.ParentID <> 1 + g_2.Count_1 > 2 AND g_2.ParentID <> 1 diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica).sql index 534f97321b2a..cff5e8925fac 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica).sql index 534f97321b2a..cff5e8925fac 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), grp_1.Year_1, grp_1.Month_1 FROM diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica).sql index afc3d9eb8899..f2e2b785522b 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM @@ -20,7 +20,7 @@ BeforeExecute -- ClickHouse.Octonica ClickHouse SELECT - sum(grp_1.MoneyValue), + sumOrNull(grp_1.MoneyValue), toYear(grp_1.Date_1), toMonth(grp_1.Date_1) FROM diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica).sql index 4cfa76d2eb05..50e6dc434da2 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(ClickHouse.Octonica).sql @@ -3,7 +3,7 @@ SELECT t1.ChildID, - avg(t1.ParentID) + avgOrNull(t1.ParentID) FROM Child t1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica).sql index 77ba4a0e4dc7..8add8884a01d 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Octonica).sql index 9fec4d03943f..2f49967cf282 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT gr.FirstName, gr.LastName, - sum(gr.PersonID) + sumOrNull(gr.PersonID) FROM Person gr GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Octonica).sql index 9fec4d03943f..2f49967cf282 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT gr.FirstName, gr.LastName, - sum(gr.PersonID) + sumOrNull(gr.PersonID) FROM Person gr GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica).sql index 417a3951e14e..2731d08b36fe 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT ip.InvestorId, t1.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id @@ -12,7 +12,7 @@ FROM INNER JOIN PaymentCalculation pc ON ipd.CalculationId = pc.Id AND p.Id = pc.EventId INNER JOIN ( SELECT - sum(b.Units) as Units, + sumOrNull(b.Units) as Units, b.InvestorId as InvestorId, b.SecurityClass as SecurityClass FROM diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica).sql index 4040d6dc29cf..5a4025524ddd 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue4098WithCte(ClickHouse.Octonica).sql @@ -6,7 +6,7 @@ WITH CTE_1 AS SELECT g_1.InvestorId, g_1.SecurityClass, - sum(g_1.Units) as Units + sumOrNull(g_1.Units) as Units FROM Transaction g_1 GROUP BY @@ -16,7 +16,7 @@ WITH CTE_1 AS SELECT ip.InvestorId, b.Units, - sum(ip.NetPayment) + sumOrNull(ip.NetPayment) FROM PaymentEvent p INNER JOIN InvestorPayment ip ON p.Id = ip.Id diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica).sql index 877d8b3a0f79..0a7fc3286f5a 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT t_1.FinalCustomerId, t_1.IsActive, - sum(t_1.Amount) + sumOrNull(t_1.Amount) FROM ( SELECT diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica).sql index 6c15138b6e8f..98383f8b4eb2 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_FilterByOrderedGroupBy(ClickHouse.Octonica).sql @@ -19,7 +19,7 @@ WHERE GROUP BY x.ParentID ORDER BY - max(x.ChildID) DESC + maxOrNull(x.ChildID) DESC LIMIT 2 ) t1 ) diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica).sql index 40ed4ea7a9d3..f053509d98d7 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.JoinMax(ClickHouse.Octonica).sql @@ -8,7 +8,7 @@ FROM Child ch INNER JOIN ( SELECT - max(max_1.ChildID) as c1 + maxOrNull(max_1.ChildID) as c1 FROM Child max_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica).sql index dfbaee5d66c8..4e9d35bb2318 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max4(ClickHouse.Octonica).sql @@ -8,7 +8,7 @@ FROM INNER JOIN ( SELECT t2.ID as ID, - max(t2.DateTimeValue) as c1 + maxOrNull(t2.DateTimeValue) as c1 FROM LinqDataTypes t2 WHERE diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica).sql index 3680df427a57..dbf21af880d0 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar1(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica).sql index ecea10bf6e4d..f929c27fffa6 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica).sql index cfe6e5af1e50..f3727944ef8b 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar2(ClickHouse.Octonica).sql @@ -2,8 +2,8 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(g_1.ChildID), - max(g_1.ChildID + g_1.ParentID) + maxOrNull(g_1.ChildID), + maxOrNull(g_1.ChildID + g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica).sql index 70386be3da8b..23f52cc0b254 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(ClickHouse.Octonica).sql @@ -2,23 +2,23 @@ -- ClickHouse.Octonica ClickHouse SELECT - g_2.MIN_2 + g_2.Min_2 FROM ( SELECT minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1, + END) as Min_1, minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_2 + END) as Min_2 FROM Child g_1 GROUP BY g_1.ParentID ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2.Min_1 IS NOT NULL diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica).sql index 8fffa3e1438b..1b98fbb380c5 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - g_2.MIN_1 + g_2.Min_1 FROM ( SELECT @@ -13,7 +13,7 @@ FROM minOrNull(CASE WHEN g_1.ParentID > 2 THEN g_1.ChildID ELSE NULL - END) as MIN_1 + END) as Min_1 FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica).sql index 0226f7577526..3c99bd613952 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(g_1.ParentID) + maxOrNull(g_1.ParentID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica).sql index 8d9686ea6b0d..5d08f0cc029e 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar7(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica).sql index 8d9686ea6b0d..5d08f0cc029e 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar8(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(id.ChildID) + maxOrNull(id.ChildID) FROM Child id GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica).sql index 3680df427a57..dbf21af880d0 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - max(g_1.ChildID) + maxOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica).sql index e1ad3e3bc017..8bb8fc6ba6c7 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(ClickHouse.Octonica).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica).sql index e1ad3e3bc017..8bb8fc6ba6c7 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(ClickHouse.Octonica).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica).sql index e1ad3e3bc017..8bb8fc6ba6c7 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(ClickHouse.Octonica).sql @@ -3,7 +3,7 @@ SELECT g_2.Key_1, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica).sql index dba3b274f9f3..b86a60703f03 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(ClickHouse.Octonica).sql @@ -3,7 +3,7 @@ SELECT g_2.n, - sum(g_2.ParentID) + sumOrNull(g_2.ParentID) FROM ( SELECT diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica).sql index 572c7d1f7d07..a6bce8ffc8d7 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 LEFT JOIN Parent p ON g_1.ParentID = p.ParentID diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica).sql index 0b713112c49d..ee0e64b62d2e 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica).sql index 0b713112c49d..ee0e64b62d2e 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(g_1.ChildID) + sumOrNull(g_1.ChildID) FROM Child g_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica).sql index acc2ed4e9742..cb3f9ad1ea27 100644 --- a/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(ClickHouse.Octonica).sql @@ -2,7 +2,7 @@ -- ClickHouse.Octonica ClickHouse SELECT - sum(g_2.ParentID - 3) + sumOrNull(g_2.ParentID - 3) FROM ( SELECT diff --git a/ClickHouse.Octonica/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Octonica).sql index d3d9c3046872..94c415c4296a 100644 --- a/ClickHouse.Octonica/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/IdlTests/Tests.Linq.IdlTests.TestDistinctWithGroupBy(ClickHouse.Octonica).sql @@ -12,7 +12,7 @@ BeforeExecute SELECT x_1.Key_1, - sum(x_1.MatchScore) + sumOrNull(x_1.MatchScore) FROM ( SELECT DISTINCT diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica).sql index d8af56a7b41e..a2b9426ed87c 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica).sql index f5be0297cd2c..60325ba74928 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(ClickHouse.Octonica).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica).sql index 849a22e6810f..37e87e801008 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,1).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,1).sql index a468d1476a85..72108cccc7ca 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,1).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,2).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,2).sql index a468d1476a85..72108cccc7ca 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,2).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - ROUND(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + ROUND(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,1).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,1).sql index f5be0297cd2c..60325ba74928 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,1).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,1).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,2).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,2).sql index f5be0297cd2c..60325ba74928 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,2).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(ClickHouse.Octonica,ToEven,2).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica).sql index 5a0d54f3971e..deb2b4f95d2e 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica).sql index f5be0297cd2c..60325ba74928 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(ClickHouse.Octonica).sql @@ -2,12 +2,11 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM ( SELECT - roundBankers(p.MoneyValue, 1) as c1, - p.MoneyValue as MoneyValue + roundBankers(p.MoneyValue, 1) as c1 FROM LinqDataTypes p ) t diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica).sql index 849a22e6810f..37e87e801008 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue), 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue), 1) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica).sql index 7b151829b2cf..a84392ca1e9c 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica).sql index d8af56a7b41e..a2b9426ed87c 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(p.MoneyValue) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(t.MoneyValue) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica).sql index 5a0d54f3971e..deb2b4f95d2e 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + roundBankers(toFloat64(p.MoneyValue)) as c1 + FROM + LinqDataTypes p + ) t WHERE - roundBankers(toFloat64(t.MoneyValue)) <> toFloat64(0) + t.c1 <> toFloat64(0) diff --git a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica).sql index df6ca612cf8a..84fe5f1dced9 100644 --- a/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(ClickHouse.Octonica).sql @@ -2,9 +2,14 @@ -- ClickHouse.Octonica ClickHouse SELECT - t.MoneyValue + t.c1 FROM - LinqDataTypes t + ( + SELECT + ROUND(p.MoneyValue, 1) as c1 + FROM + LinqDataTypes p + ) t WHERE - ROUND(t.MoneyValue, 1) <> toDecimal64('0', 4) + t.c1 <> toDecimal64('0', 4) diff --git a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica).sql index de33b999b37e..8be1e92ebbcc 100644 --- a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(ClickHouse.Octonica).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica).sql index de33b999b37e..8be1e92ebbcc 100644 --- a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(ClickHouse.Octonica).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 2 + s.Int = 2 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 2 + s.Int <> 2 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int = 4 + s.Int = 4 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.Int <> 4 + s.Int <> 4 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 2 OR x.NullableInt IS NULL + s.NullableInt = 2 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 2 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 2 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt = 4 OR x.NullableInt IS NULL + s.NullableInt = 4 OR s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableInt = 4 OR x.NullableInt IS NULL) + NOT (s.NullableInt = 4 OR s.NullableInt IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NULL + s.NullableInt IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableInt IS NOT NULL + s.NullableInt IS NOT NULL diff --git a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica).sql index 839df70fc013..042251958397 100644 --- a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(ClickHouse.Octonica).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica).sql index 839df70fc013..042251958397 100644 --- a/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(ClickHouse.Octonica).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'abc' OR x.String IS NULL + s.String = 'abc' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'abc' OR x.String IS NULL) + NOT (s.String = 'abc' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String = 'xyz' OR x.String IS NULL + s.String = 'xyz' OR s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.String = 'xyz' OR x.String IS NULL) + NOT (s.String = 'xyz' OR s.String IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NULL + s.String IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.String IS NOT NULL + s.String IS NOT NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'abc' OR x.NullableString IS NULL + s.NullableString = 'abc' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'abc' OR x.NullableString IS NULL) + NOT (s.NullableString = 'abc' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString = 'xyz' OR x.NullableString IS NULL + s.NullableString = 'xyz' OR s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - NOT (x.NullableString = 'xyz' OR x.NullableString IS NULL) + NOT (s.NullableString = 'xyz' OR s.NullableString IS NULL) BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NULL + s.NullableString IS NULL BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - Src x + Src s WHERE - x.NullableString IS NOT NULL + s.NullableString IS NOT NULL diff --git a/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica).sql index 09b4f5bf7ba0..188d8d3127c7 100644 --- a/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByDistinctTest(ClickHouse.Octonica).sql @@ -17,7 +17,7 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1) + maxOrNull(x.OrderData1) LIMIT 0, 3 BeforeExecute @@ -39,6 +39,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - min(x.OrderData1) DESC + minOrNull(x.OrderData1) DESC LIMIT 0, 3 diff --git a/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica).sql index 7cb9482b760d..f6504ba8c991 100644 --- a/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderByExpressionDistinctTests(ClickHouse.Octonica).sql @@ -17,6 +17,6 @@ FROM GROUP BY x.DuplicateData ORDER BY - max(x.OrderData1 % 3) + maxOrNull(x.OrderData1 % 3) LIMIT 0, 3 diff --git a/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica).sql index ec9462eb120a..175671e5d7f1 100644 --- a/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica).sql index ec9462eb120a..175671e5d7f1 100644 --- a/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica).sql index ec9462eb120a..175671e5d7f1 100644 --- a/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT a_Patient.Diagnosis, a_Patient.PersonID, - avg(auto16031.PersonID) + avgOrNull(auto16031.PersonID) FROM Person auto16031 LEFT JOIN Patient a_Patient ON auto16031.PersonID = a_Patient.PersonID diff --git a/ClickHouse.Octonica/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica).sql index de97e3053bfe..5f524cb0156d 100644 --- a/ClickHouse.Octonica/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(ClickHouse.Octonica).sql @@ -5,13 +5,13 @@ SELECT COUNT(*) OVER(), x.Key_1, x.Count_1, - x.MAX_1 + x.Max_1 FROM ( SELECT summary.LastName as Key_1, COUNT(*) as Count_1, - max(summary.FirstName) as MAX_1 + maxOrNull(summary.FirstName) as Max_1 FROM Person summary GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica).sql index 3c8f6628612f..7c934a317d36 100644 --- a/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Index(ClickHouse.Octonica).sql @@ -10,7 +10,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 @@ -33,7 +33,7 @@ FROM ( SELECT m_1.ChildID as ChildID, - ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - 1 as c1, + ROW_NUMBER() OVER (ORDER BY m_1.ChildID DESC) - toInt64(1) as c1, a_Parent.ParentID as ParentID FROM Child m_1 diff --git a/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica).sql index d6bd45207656..a3f6336d3bf9 100644 --- a/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexer(ClickHouse.Octonica).sql @@ -8,7 +8,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY p.PersonID DESC) - toInt64(1) as Index_1, p.FirstName as FirstName, p.LastName as LastName, p.PersonID as PersonID @@ -16,7 +16,7 @@ FROM Person p ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.PersonID DESC diff --git a/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica).sql index 894427522beb..d9a811461055 100644 --- a/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/SelectTests/Tests.Linq.SelectTests.SelectWithIndexerAfterGroupBy(ClickHouse.Octonica).sql @@ -7,7 +7,7 @@ SELECT FROM ( SELECT - ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - 1 as Index_1, + ROW_NUMBER() OVER (ORDER BY g_2.Key_1 DESC) - toInt64(1) as Index_1, g_2.Key_1 as Key_1 FROM ( @@ -20,7 +20,7 @@ FROM ) g_2 ) x WHERE - x.Index_1 > 0 + x.Index_1 > toInt64(0) ORDER BY x.Key_1 DESC diff --git a/ClickHouse.Octonica/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Octonica).sql index 5f3d10c6fc57..baa0c4f5dbb0 100644 --- a/ClickHouse.Octonica/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(ClickHouse.Octonica).sql @@ -2,17 +2,21 @@ -- ClickHouse.Octonica ClickHouse SELECT - arrayStringConcat([t.Value2], ' -> ') + Coalesce(t.Value2, '') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.Octonica ClickHouse SELECT - arrayStringConcat([t.Value3], ' -> ') + Coalesce(t.Value3, '') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -21,6 +25,8 @@ SELECT arrayStringConcat([t.Value3, t.Value1, t.Value2], ' -> ') FROM SampleClass t +ORDER BY + t.Id BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -29,4 +35,6 @@ SELECT arrayStringConcat([t.Value3, t.Value3], ' -> ') FROM SampleClass t +ORDER BY + t.Id diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..2cbb99518a9a --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(ClickHouse.Octonica).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + x.c1 +FROM + ( + SELECT + arrayStringConcat([CASE + WHEN position(t.NullableValue, 'A') > 0 THEN t.NullableValue + ELSE NULL + END, CASE + WHEN position(t.NotNullableValue, 'A') > 0 THEN t.NotNullableValue + ELSE NULL + END, CASE + WHEN position(t.VarcharValue, 'A') > 0 THEN t.VarcharValue + ELSE NULL + END, CASE + WHEN position(t.NVarcharValue, 'A') > 0 THEN t.NVarcharValue + ELSE NULL + END], ', ') as c1 + FROM + SampleClass t + ) x +WHERE + NOT empty(replaceRegexpAll(coalesce(x.c1, ''), ' | +| | | | |…| | | | | | | | | | | | | |
|
| | ', '')) + +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..b59e2c876d18 --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(ClickHouse.Octonica).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((t1.NotNullableValue, toString(Coalesce(t1.NullableValue, '')))))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..0054e5f621c2 --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(ClickHouse.Octonica).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse (asynchronously) + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..c1b9dc518be9 --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(ClickHouse.Octonica).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + Coalesce(arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArrayIf((t1.NotNullableValue, toString(t1.NullableValue)), t1.NullableValue IS NOT NULL))), ', '), '') +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..9e7c7e05e57c --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(ClickHouse.Octonica).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(groupArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + arrayStringConcat(groupArray(toString(g_1.NotNullableValue)), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..2df3f04093c8 --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(ClickHouse.Octonica).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupUniqArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL)))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupUniqArray((Coalesce(g_1.NullableValue, ''), toString(Coalesce(g_1.NullableValue, ''))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..29f4e72a676a --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(ClickHouse.Octonica).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(arrayMap((t) -> tupleElement(t, 3), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1, if(isNull(t.2), 0, 1), t.2), groupArrayIf((g_1.NullableValue, g_1.Id, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arraySort((t) -> (if(isNull(t.1), 0, 1), t.1), groupArray((g_1.NullableValue, toString(Coalesce(g_1.NullableValue, '')))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Octonica).sql new file mode 100644 index 000000000000..e9e00154590e --- /dev/null +++ b/ClickHouse.Octonica/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(ClickHouse.Octonica).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + g_1.Id, + arrayStringConcat(groupUniqArray(toString(Coalesce(g_1.NullableValue, ''))), ', '), + Coalesce(arrayStringConcat(groupUniqArrayIf(toString(g_1.NullableValue), g_1.NullableValue IS NOT NULL), ', '), ''), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArrayIf((g_1.NullableValue, toString(g_1.NullableValue)), g_1.NullableValue IS NOT NULL))))), ', '), + arrayStringConcat(groupUniqArray(toString(g_1.NotNullableValue)), ', '), + arrayStringConcat(arrayMap((t) -> tupleElement(t, 2), arrayDistinct(arrayReverse(arraySort((t) -> (if(isNull(t.1), 1, 0), t.1), groupUniqArray((g_1.NotNullableValue, toString(g_1.NotNullableValue))))))), ', ') +FROM + SampleClass g_1 +GROUP BY + g_1.Id +ORDER BY + g_1.Id + +BeforeExecute +-- ClickHouse.Octonica ClickHouse + +SELECT + t1.Id, + t1.NullableValue, + t1.NotNullableValue, + t1.VarcharValue, + t1.NVarcharValue +FROM + SampleClass t1 + diff --git a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica).sql index 76056817098c..75fac6d34df4 100644 --- a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica).sql index 76056817098c..75fac6d34df4 100644 --- a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test2(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(VBIt.added) + maxOrNull(VBIt.added) FROM activity649 VBIt INNER JOIN person649 a_Person ON VBIt.personid = a_Person.personid diff --git a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica).sql index 8d766281ae34..341b41e89336 100644 --- a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT a_Person.personid, a_Person.personname, - max(f.added) + maxOrNull(f.added) FROM activity649 f INNER JOIN person649 a_Person ON f.personid = a_Person.personid diff --git a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica).sql index 23c8cdb18a45..184595c8eacf 100644 --- a/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT data_1.ParentID, data_1.ChildID, - max(data_1.ChildID) + maxOrNull(data_1.ChildID) FROM Child data_1 GROUP BY diff --git a/ClickHouse.Octonica/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica).sql index 8757ce680a5a..f50ff3ad3f45 100644 --- a/ClickHouse.Octonica/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(ClickHouse.Octonica).sql @@ -2,12 +2,12 @@ -- ClickHouse.Octonica ClickHouse SELECT - g_1.COUNT_1 + g_1.Count_1 FROM ( SELECT c_1.ParentID as Key_1, - COUNT(*) as COUNT_1 + COUNT(*) as Count_1 FROM Child c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1.ParentID > 1 ) g_1 WHERE - g_1.Key_1 > 1 AND g_1.COUNT_1 > 1 + g_1.Key_1 > 1 AND g_1.Count_1 > 1 diff --git a/ClickHouse.Octonica/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Octonica).sql index 4364d7236e54..10b2666330b4 100644 --- a/ClickHouse.Octonica/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.SelectPure(ClickHouse.Octonica).sql @@ -4,7 +4,7 @@ SELECT 'Title', it.Title, - sum(it.YearsExperience) + sumOrNull(it.YearsExperience) FROM odata_person it GROUP BY diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica).sql index 408786c047d3..10ac71310b8d 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(ClickHouse.Octonica).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Octonica).sql index 408786c047d3..10ac71310b8d 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(ClickHouse.Octonica).sql @@ -3,11 +3,11 @@ SELECT COUNT(*) * 100E0 / SUM(COUNT(*)) OVER(), - sum(t1.ParentID) + sumOrNull(t1.ParentID) FROM Child t1 GROUP BY t1.ParentID HAVING - sum(t1.ParentID) <> 36 + sumOrNull(t1.ParentID) <> 36 OR sumOrNull(t1.ParentID) IS NULL diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica).sql index 8f51429984e5..88cfa5256ef6 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(ClickHouse.Octonica).sql @@ -3,11 +3,11 @@ SELECT (toFloat64(COUNT(*)) * toFloat64(100)) / SUM(COUNT(*)) OVER(), - sum(g_1.ParentID) + sumOrNull(g_1.ParentID) FROM Child g_1 GROUP BY g_1.ParentID HAVING - sum(g_1.ParentID) <> 36 + sumOrNull(g_1.ParentID) <> 36 OR sumOrNull(g_1.ParentID) IS NULL diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Octonica).sql index 28dea96eb1fa..95176618c273 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(ClickHouse.Octonica).sql @@ -7,17 +7,12 @@ SELECT d.ChildID FROM ( - SELECT DISTINCT - t2.ParentID as ParentID + SELECT + a_Parent.ParentID as ParentID FROM - ( - SELECT - a_Parent.ParentID as ParentID - FROM - Child t1 - LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID - LIMIT 1 - ) t2 + Child t1 + LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID + LIMIT 1 ) m_1 INNER JOIN Child d ON m_1.ParentID = d.ParentID diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Octonica).sql index 28dea96eb1fa..95176618c273 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(ClickHouse.Octonica).sql @@ -7,17 +7,12 @@ SELECT d.ChildID FROM ( - SELECT DISTINCT - t2.ParentID as ParentID + SELECT + a_Parent.ParentID as ParentID FROM - ( - SELECT - a_Parent.ParentID as ParentID - FROM - Child t1 - LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID - LIMIT 1 - ) t2 + Child t1 + LEFT JOIN Parent a_Parent ON t1.ParentID = a_Parent.ParentID + LIMIT 1 ) m_1 INNER JOIN Child d ON m_1.ParentID = d.ParentID diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Octonica).sql index 409358bd2f19..ee597efab41d 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(ClickHouse.Octonica).sql @@ -9,7 +9,7 @@ SELECT END, CASE WHEN i.SettlementTotalOnIssue IS NOT NULL THEN i.SettlementTotalOnIssue - WHEN ia.InvoiceID IS NOT NULL THEN ia.SUM_1 + WHEN ia.InvoiceId IS NOT NULL THEN ia.Total ELSE NULL END FROM @@ -17,8 +17,8 @@ FROM LEFT JOIN InvoiceReferenceNumber r ON r.InvoiceReferenceNumberID = i.InvoiceReferenceNumberID LEFT JOIN ( SELECT - g_1.InvoiceID as InvoiceID, - sum(ili.BillingAmountOverride) as SUM_1 + g_1.InvoiceID as InvoiceId, + sumOrNull(ili.BillingAmountOverride) as Total FROM Invoice g_1 INNER JOIN InvoiceLineItem ili ON ili.OwningInvoiceID = g_1.InvoiceID @@ -26,7 +26,7 @@ FROM NOT ili.Suppressed GROUP BY g_1.InvoiceID - ) ia ON ia.InvoiceID = i.InvoiceID + ) ia ON ia.InvoiceId = i.InvoiceID BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -52,7 +52,7 @@ SELECT ELSE r.ReferenceNumber END, CASE - WHEN ia.InvoiceID IS NOT NULL THEN ia.SUM_1 + WHEN ia.InvoiceId IS NOT NULL THEN ia.Total ELSE NULL END FROM @@ -60,8 +60,8 @@ FROM LEFT JOIN InvoiceReferenceNumber r ON r.InvoiceReferenceNumberID = i.InvoiceReferenceNumberID LEFT JOIN ( SELECT - g_1.InvoiceID as InvoiceID, - sum(ili.BillingAmountOverride) as SUM_1 + g_1.InvoiceID as InvoiceId, + sumOrNull(ili.BillingAmountOverride) as Total FROM Invoice g_1 INNER JOIN InvoiceLineItem ili ON ili.OwningInvoiceID = g_1.InvoiceID @@ -69,5 +69,5 @@ FROM NOT ili.Suppressed GROUP BY g_1.InvoiceID - ) ia ON ia.InvoiceID = i.InvoiceID + ) ia ON ia.InvoiceId = i.InvoiceID diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Octonica).sql index 27e5b91e45db..7588e9d6a03b 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(ClickHouse.Octonica).sql @@ -2,7 +2,11 @@ -- ClickHouse.Octonica ClickHouse SELECT - concat('Issue1977Table/', toString(f.firstField), '/', toString(f.secondField)) = arrayStringConcat(['Issue1977Table', toString(f.firstField), toString(f.secondField)], '/') + CASE + WHEN concat('Issue1977Table/', toString(f.firstField), '/', toString(f.secondField)) = arrayStringConcat(['Issue1977Table', toString(f.firstField), toString(f.secondField)], '/') + THEN true + ELSE false + END FROM Issue1977Table f diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica).sql index c183b49d834c..3f8b97e3d3fa 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(ClickHouse.Octonica).sql @@ -18,7 +18,7 @@ FROM vpc.CategoryId as CategoryId, pop.ProductId as ProductId, COALESCE(pcc.PeriodOrderLimit,0) as MaxCapacity, - COALESCE(COALESCE(vsp.SUM_1,0),0) as Quantity + COALESCE(COALESCE(vsp.Quantity,0),0) as Quantity FROM OrderPeriod op INNER JOIN ProductsPerOrderPeriod pop ON op.Id = pop.OrderPeriodId @@ -28,7 +28,7 @@ FROM SELECT agroup.Id as Id, oi.ProductId as ProductId, - sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as SUM_1 + sumOrNull(COALESCE(oi.Quantity,toInt16(0))) as Quantity FROM OrderPeriod agroup LEFT JOIN OrderHeader oh ON agroup.Id = oh.PeriodId diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica).sql b/ClickHouse.Octonica/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica).sql index 1067c4fbfc52..fd752fbf5585 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue4800Tests/Tests.UserTests.Issue4800Tests.JoinUsingAggregateResult(ClickHouse.Octonica).sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - min(elements_1.TesteeId) as TesteeId + minOrNull(elements_1.TesteeId) as TesteeId FROM ( SELECT diff --git a/MySql.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..9a5fc9b41db5 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySql.8.0.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + MIN(`t1`.`ParentID`) +FROM + `Parent` `t1` +WHERE + `t1`.`ParentID` < 0 + diff --git a/MySql.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..486e21286136 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySql.8.0.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + ( + SELECT + MIN(`a_Children`.`ParentID`) + FROM + `Child` `a_Children` + WHERE + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ParentID` < 0 + ) +FROM + `Parent` `p` + diff --git a/MySql.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0.LinqService).sql index 443bd79d1a36..9922d46671d7 100644 --- a/MySql.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0.LinqService).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ `p`.`ParentID`, `p`.`Value1`, - `t1`.`COUNT_1` + `t1`.`Count_1` FROM ( SELECT /*+ QB_NAME(Inline) */ `c_1`.`ParentID`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY diff --git a/MySql.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0.LinqService).sql index 7e5c22520b0b..6982b1a3b5f0 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY `tt`.`Key_1` HAVING - SUM(`tt`.`ID`) <> 0 + SUM(`tt`.`ID`) <> 0 OR SUM(`tt`.`ID`) IS NULL diff --git a/MySql.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0.LinqService,False).sql b/MySql.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0.LinqService,False).sql index 49060cc486aa..577cd2b73010 100644 --- a/MySql.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0.LinqService,False).sql +++ b/MySql.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0.LinqService,False).sql @@ -2,27 +2,23 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` IN (@In, @In_1) + `s`.`CEnum` IN (@In, @In) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` NOT IN (@NotIn, @NotIn_1) + `s`.`CEnum` NOT IN (@NotIn, @NotIn) diff --git a/MySql.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0.LinqService).sql index 9490e43c403a..96b9e2884d21 100644 --- a/MySql.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `p`.`ID` + CAST(CAST(`p`.`ID` AS UNSIGNED) AS CHAR(3)) FROM `LinqDataTypes` `p` WHERE diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0.LinqService).sql index 1e41b6fd972b..0b02ed864703 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0.LinqService).sql @@ -11,7 +11,7 @@ FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` - ) `g_2` + ) `t1` WHERE - `g_2`.`ParentID` > 2 + `t1`.`ParentID` > 2 diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0.LinqService).sql index 4702d32301ea..31bd57ba1da2 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0.LinqService).sql index 6e5343401f7a..5c7f243a033a 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0.LinqService).sql index d7ae2dcd0602..4f0e58fca259 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0.LinqService).sql @@ -2,22 +2,22 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0.LinqService).sql index d7ae2dcd0602..4f0e58fca259 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0.LinqService).sql @@ -2,22 +2,22 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0.LinqService).sql index de6530a8dd7b..1a3e12aa4a50 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1` + END) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 OR `g_2`.`Key_1` > 2 + `g_2`.`Count_1` > 2 OR `g_2`.`Key_1` > 2 diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0.LinqService).sql index 841a590d0db9..71af881b5d4d 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`Key_1` < 5 + `g_2`.`Count_1` > 2 AND `g_2`.`Key_1` < 5 diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0.LinqService).sql index f132a6ee1962..387e0e21c08f 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 3 OR `g_2`.`Key_1` = 1 + `g_2`.`Count_1` > 3 OR `g_2`.`Key_1` = 1 diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0.LinqService).sql index 5fee27f17758..d25881e9dd44 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t2`.`COUNT_1` + `t2`.`COUNT_1` + `t2`.`Count_1` + `t2`.`Count_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM `Child` `c_1` WHERE `t1`.`ParentID` = `c_1`.`ParentID` - ) as `COUNT_1` + ) as `Count_1` FROM `Parent` `t1` ) `t2` diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0.LinqService).sql index 8b4e8f7ca9db..e414a1f06a82 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0.LinqService).sql index 8b4e8f7ca9db..e414a1f06a82 100644 --- a/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySql.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0.LinqService).sql index 670e88e6e255..f3b4d8c70a88 100644 --- a/MySql.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t2`.`SUM_1` + `t2`.`Sum_1` FROM `Parent` `p` LEFT JOIN LATERAL ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN `d`.`ParentID` IS NOT NULL THEN `d`.`ParentID` ELSE -100 - END) as `SUM_1` + END) as `Sum_1` FROM ( SELECT diff --git a/MySql.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..549a4404af2c --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0.LinqService).sql index f19dc94049d7..4f2888be6bee 100644 --- a/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0.LinqService).sql @@ -2,13 +2,13 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t3`.`SUM_1`, - `t6`.`COUNT_1` + `t3`.`Sum_1`, + `t6`.`Count_1` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - SUM(`t2`.`DetailId`) as `SUM_1` + SUM(`t2`.`DetailId`) as `Sum_1` FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) `t3` ON 1=1 LEFT JOIN LATERAL ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM ( SELECT diff --git a/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0.LinqService).sql index 1c91ae4ffe82..1922dd06f11f 100644 --- a/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0.LinqService).sql @@ -2,12 +2,12 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t3`.`AVG_1` + `t3`.`Average` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `AVG_1` + AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `Average` FROM ( SELECT diff --git a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0.LinqService).sql index 49a08a5c889d..8703cf76476b 100644 --- a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 0 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 0 ) FROM `Parent` `p` diff --git a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0.LinqService).sql index 82624f7912e5..9142ba88a7c5 100644 --- a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 1 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 1 ) FROM `Parent` `p` diff --git a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0.LinqService).sql index 5e75d19b66f9..f7fdcf7147e9 100644 --- a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 2 FROM `Parent` `p` diff --git a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0.LinqService).sql index 902f51a651ef..ff5c32fa9c39 100644 --- a/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 4 FROM `Parent` `p` diff --git a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0.LinqService).sql index 206cef4a628d..f277dc4d1cdb 100644 --- a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0.LinqService).sql @@ -2,97 +2,41 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t7`.`Key_1`, - `t7`.`COUNT_1`, - `t7`.`COUNT_2`, - `t7`.`COUNT_3`, - `t7`.`COUNT_4`, - `t1`.`COUNT_1`, - `t3`.`COUNT_1`, - `t4`.`COUNT_1`, - `t7`.`COUNT_5`, - `t6`.`COUNT_1` + `t`.`GroupId`, + COUNT(*), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT `t`.`DataValue`), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT `t`.`DataValue`) FROM - ( - SELECT - `t`.`GroupId` as `Key_1`, - COUNT(*) as `COUNT_1`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_2`, - COUNT(*) as `COUNT_3`, - COUNT(DISTINCT `t`.`DataValue`) as `COUNT_4`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_5` - FROM - `AggregationData` `t` - WHERE - `t`.`DataValue` IS NOT NULL - GROUP BY - `t`.`GroupId` - ) `t7` - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x`.`DataValue` - FROM - `AggregationData` `x` - WHERE - `x`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x`.`GroupId` - ) `x_1` - WHERE - `x_1`.`DataValue` % 2 = 0 - ) `t1` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_1`.`DataValue` - FROM - `AggregationData` `t_1` - WHERE - `t_1`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_1`.`GroupId` AND - `t_1`.`DataValue` % 2 = 0 - ) `t2` - ) `t3` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x_2`.`DataValue` - FROM - `AggregationData` `x_2` - WHERE - `x_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x_2`.`GroupId` AND - `x_2`.`DataValue` % 2 = 0 - ) `x_3` - WHERE - `x_3`.`DataValue` % 2 = 0 - ) `t4` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_2`.`DataValue` - FROM - `AggregationData` `t_2` - WHERE - `t_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_2`.`GroupId` AND - `t_2`.`DataValue` % 2 = 0 - ) `t5` - ) `t6` ON 1=1 + `AggregationData` `t` +WHERE + `t`.`DataValue` IS NOT NULL +GROUP BY + `t`.`GroupId` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) diff --git a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0.LinqService).sql index fd1763bc294f..b4c041968724 100644 --- a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT `a_Parent`.`ParentID`, - COUNT(*) as `COUNT_1`, + COUNT(*) as `Count_1`, `a_Parent`.`Value1` FROM `GrandChild` `g_1` @@ -17,5 +17,5 @@ FROM `a_Parent`.`Value1` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`ParentID` <> 1 + `g_2`.`Count_1` > 2 AND `g_2`.`ParentID` <> 1 diff --git a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0.LinqService).sql index d0375d59431e..800bc92cc442 100644 --- a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0.LinqService).sql @@ -2,23 +2,23 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `g_2`.`MIN_2` + `g_2`.`Min_2` FROM ( SELECT MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1`, + END) as `Min_1`, MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_2` + END) as `Min_2` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`MIN_1` IS NOT NULL + `g_2`.`Min_1` IS NOT NULL diff --git a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0.LinqService).sql index 16b8009c6895..9cd41c504595 100644 --- a/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `g_2`.`MIN_1` + `g_2`.`Min_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1` + END) as `Min_1` FROM `Child` `g_1` GROUP BY diff --git a/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,5).sql b/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,5).sql index 5be5b40b8bb6..8b88b1b1d027 100644 --- a/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,5).sql +++ b/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,5).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 @@ -10,5 +10,5 @@ BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` diff --git a/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,6).sql b/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,6).sql index f5472017109a..4681455f3155 100644 --- a/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,6).sql +++ b/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,6).sql @@ -2,13 +2,13 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,null).sql b/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,null).sql index f5472017109a..4681455f3155 100644 --- a/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,null).sql +++ b/MySql.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0.LinqService,null).sql @@ -2,13 +2,13 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0.LinqService).sql index edbdcfb46cad..50cae98e0ffc 100644 --- a/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0.LinqService).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertKey`, `al_group_2`.`AlertCode`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0.LinqService).sql index 137dc69c9887..caef7156a409 100644 --- a/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0.LinqService).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertCode`, `al_group_2`.`AlertKey`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0.LinqService).sql index 4a36d0f0fd92..44d690883998 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0.LinqService).sql index b90d5f523cfe..cf4dbc1e2d94 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0.LinqService).sql index 4c4b430b696e..4eb103f734a9 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,1).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,1).sql index b7948c19b239..71dfd2ab4f4c 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,1).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,2).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,2).sql index b7948c19b239..71dfd2ab4f4c 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,2).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,1).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,1).sql index b90d5f523cfe..cf4dbc1e2d94 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,1).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,2).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,2).sql index b90d5f523cfe..cf4dbc1e2d94 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,2).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0.LinqService).sql index 4a36d0f0fd92..44d690883998 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0.LinqService).sql index b90d5f523cfe..cf4dbc1e2d94 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0.LinqService).sql index 4c4b430b696e..4eb103f734a9 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0.LinqService).sql index ee07f21c0d54..9b2a89fdd068 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0.LinqService).sql @@ -2,9 +2,14 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0.LinqService).sql index ee07f21c0d54..9b2a89fdd068 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0.LinqService).sql @@ -2,9 +2,14 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0.LinqService).sql index 4a36d0f0fd92..44d690883998 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0.LinqService).sql index 4a36d0f0fd92..44d690883998 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0.LinqService).sql index c383330474e5..d6dd7e9be3ca 100644 --- a/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0.LinqService).sql @@ -2,9 +2,14 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`, 1) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`, 1) <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0.LinqService).sql index 3e89cb1e5f09..169a76e1c2e9 100644 --- a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0.LinqService).sql index 3e89cb1e5f09..169a76e1c2e9 100644 --- a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0.LinqService).sql index 73718f2d7cea..75aec2165e43 100644 --- a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0.LinqService).sql index 73718f2d7cea..75aec2165e43 100644 --- a/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySql.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0.LinqService).sql index 14c7b80595da..cdf209928a40 100644 --- a/MySql.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), `x`.`Key_1`, `x`.`Count_1`, - `x`.`MAX_1` + `x`.`Max_1` FROM ( SELECT `summary`.`LastName` as `Key_1`, COUNT(*) as `Count_1`, - MAX(`summary`.`FirstName`) as `MAX_1` + MAX(`summary`.`FirstName`) as `Max_1` FROM `Person` `summary` GROUP BY diff --git a/MySql.8.0.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..8ccf0bb08411 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySql.8.0.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value2`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value3`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value1`, `t`.`Value2`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value3`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..2f43098e9cdb --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySql.8.0.LinqService).sql @@ -0,0 +1,52 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(`t`.`NullableValue`, ''), `t`.`NotNullableValue`, Coalesce(`t`.`VarcharValue`, ''), Coalesce(`t`.`NVarcharValue`, '')), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT CASE + WHEN `t2`.`item` <> 'A' OR `t2`.`item` IS NULL THEN Coalesce(`t2`.`item`, '') + ELSE NULL + END ORDER BY CASE + WHEN `t2`.`item` IS NULL THEN 0 + ELSE 1 + END, `t2`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t2` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..83e2c55dda8b --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySql.8.0.LinqService).sql @@ -0,0 +1,33 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + CONCAT_WS(', ', `t`.`NullableValue`, `t`.`NotNullableValue`, `t`.`VarcharValue`, `t`.`NVarcharValue`), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`VarcharValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..71ae603437f7 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySql.8.0.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `x`.`c1` +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN LOCATE('A', `t`.`NullableValue`) > 0 THEN `t`.`NullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NotNullableValue`) > 0 THEN `t`.`NotNullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`VarcharValue`) > 0 THEN `t`.`VarcharValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NVarcharValue`) > 0 THEN `t`.`NVarcharValue` + ELSE NULL + END) as `c1` + FROM + `SampleClass` `t` + ) `x` +WHERE + `x`.`c1` RLIKE '[^ + …             

  ]' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..fedbad259d4d --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySql.8.0.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..2ff2eb1572af --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySql.8.0.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..2ff2eb1572af --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySql.8.0.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..bda1b3c7dd67 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySql.8.0.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..68c4bd3503d8 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySql.8.0.LinqService).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t5`.`Key_1`, + `t2`.`Join_1`, + `t4`.`Join_1` +FROM + ( + SELECT + `g_1`.`Id` as `Key_1` + FROM + `SampleClass` `g_1` + GROUP BY + `g_1`.`Id` + ) `t5` + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x`.`NullableValue` + FROM + `SampleClass` `x` + WHERE + `t5`.`Key_1` = `x`.`Id` + ORDER BY + `x`.`NotNullableValue` + LIMIT 2 + ) `t1` + ) `t2` ON 1=1 + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(`t3`.`NotNullableValue` SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x_1`.`NotNullableValue` + FROM + `SampleClass` `x_1` + WHERE + `t5`.`Key_1` = `x_1`.`Id` + ORDER BY + `x_1`.`NotNullableValue` + LIMIT 2 + ) `t3` + ) `t4` ON 1=1 +ORDER BY + `t5`.`Key_1` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..cee4fbfc8beb --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySql.8.0.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') ORDER BY Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..ecdba8d563a1 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySql.8.0.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(`g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..e7268df49c92 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySql.8.0.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), + Coalesce(GROUP_CONCAT(CASE + WHEN `g_1`.`NullableValue` <> '' THEN `g_1`.`NullableValue` + ELSE NULL + END ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY CASE + WHEN `g_1`.`NullableValue` IS NULL THEN 0 + ELSE 1 + END, `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySql.8.0.LinqService).sql new file mode 100644 index 000000000000..bf06c94cc304 --- /dev/null +++ b/MySql.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySql.8.0.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` SEPARATOR ', '), ''), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` SEPARATOR ', '), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0.LinqService).sql index e4d665c74c49..422f08f5edf2 100644 --- a/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0.LinqService).sql @@ -7,30 +7,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) diff --git a/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0.LinqService).sql index 73430afa455d..869151ea59b3 100644 --- a/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0.LinqService).sql @@ -7,30 +7,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) diff --git a/MySql.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0.LinqService).sql index 83789018076a..de8ebb8f2f4b 100644 --- a/MySql.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0.LinqService).sql @@ -2,12 +2,12 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) SELECT - `g_1`.`COUNT_1` + `g_1`.`Count_1` FROM ( SELECT `c_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY @@ -16,5 +16,5 @@ FROM `c_1`.`ParentID` > 1 ) `g_1` WHERE - `g_1`.`Key_1` > 1 AND `g_1`.`COUNT_1` > 1 + `g_1`.`Key_1` > 1 AND `g_1`.`Count_1` > 1 diff --git a/MySql.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/MySql.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 57b3d65c6716..c53a5b918bfa 100644 --- a/MySql.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/MySql.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT `d`.`ValB`, `d`.`ValInt` FROM - ( - SELECT DISTINCT - `l1`.`ID`, - `l1`.`ValS` + `Issue3757Level1` `m_1` + INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` +WHERE + EXISTS( + SELECT + * FROM - `Issue3757Level1` `l1` + `Issue3757Level2` `c_1` WHERE - EXISTS( - SELECT - * - FROM - `Issue3757Level2` `c_1` - WHERE - `l1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `l1`.`ValS`) > 0 AND - `l1`.`ValS` IS NOT NULL - ) - ) `m_1` - INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` + `m_1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `m_1`.`ValS`) > 0 AND + `m_1`.`ValS` IS NOT NULL + ) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) diff --git a/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0.LinqService).sql index 1a8521842fb2..a06ebc8878fb 100644 --- a/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x_1`.`ParentID`, `x_1`.`CountResult`, - `x_1`.`SUM_1` + `x_1`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `od_1` WHERE `x`.`ParentID` = `od_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `x` ) `x_1` diff --git a/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0.LinqService).sql index ddb329bafb3f..9fde3add73f3 100644 --- a/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x`.`ParentID`, `x`.`CountResult`, - `x`.`SUM_1` + `x`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `a_Children_1` WHERE `o`.`ParentID` = `a_Children_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `o` ) `x` diff --git a/MySql.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0.LinqService).sql index ef005c8cf319..07fa2141da6b 100644 --- a/MySql.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0.LinqService).sql @@ -20,7 +20,7 @@ FROM `vpc`.`CategoryId`, `pop`.`ProductId`, COALESCE(`pcc`.`PeriodOrderLimit`,0) as `MaxCapacity`, - COALESCE(COALESCE(`vsp`.`SUM_1`,0),0) as `Quantity` + COALESCE(COALESCE(`vsp`.`Quantity`,0),0) as `Quantity` FROM `OrderPeriod` `op` INNER JOIN `ProductsPerOrderPeriod` `pop` ON `op`.`Id` = `pop`.`OrderPeriodId` @@ -30,7 +30,7 @@ FROM SELECT `agroup`.`Id`, `oi`.`ProductId`, - SUM(COALESCE(`oi`.`Quantity`,0)) as `SUM_1` + SUM(COALESCE(`oi`.`Quantity`,0)) as `Quantity` FROM `OrderPeriod` `agroup` LEFT JOIN `OrderHeader` `oh` ON `agroup`.`Id` = `oh`.`PeriodId` diff --git a/MySql.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0.LinqService).sql index 3f0d869d298c..a6959eb321ad 100644 --- a/MySql.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0.LinqService).sql @@ -3,7 +3,7 @@ SELECT Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11))), - `t1`.`SUM_1`, + `t1`.`SubSum`, EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN `Parent` `a_Parent` ON `c_1`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = `f`.`ParentID` AND (`a_Parent`.`Value1` = `f`.`Value1` OR `a_Parent`.`Value1` IS NULL AND `f`.`Value1` IS NULL) - ) as `SUM_1`, + ) as `SubSum`, `f`.`ParentID` FROM `Parent` `f` ) `t1` WHERE LOCATE('1', Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11)))) > 0 AND - `t1`.`SUM_1` > 0 + `t1`.`SubSum` > 0 diff --git a/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0.LinqService).sql index 74ab185549b9..abd28b5e6a1a 100644 --- a/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0.LinqService).sql @@ -5,13 +5,13 @@ SELECT `p1`.`ParentID`, `p1`.`Value1`, `p2`.`Key_1`, - `p2`.`SUM_1` + `p2`.`Sum_1` FROM `Parent` `p1` INNER JOIN ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0.LinqService).sql index 4ded41d2907e..19fd175953d8 100644 --- a/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0.LinqService).sql @@ -3,14 +3,14 @@ SELECT `t1`.`Key_1`, - `t1`.`SUM_1`, + `t1`.`Sum_1`, `p2`.`Key_1`, `p2`.`Sum_1` FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0.LinqService).sql index 6e0dfc9ad53c..ecbde0529d04 100644 --- a/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0.LinqService).sql b/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0.LinqService).sql index 6e0dfc9ad53c..ecbde0529d04 100644 --- a/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0.LinqService).sql +++ b/MySql.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/MySql.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySql.8.0).sql b/MySql.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySql.8.0).sql new file mode 100644 index 000000000000..cda7e9a425c0 --- /dev/null +++ b/MySql.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySql.8.0).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + MIN(`t1`.`ParentID`) +FROM + `Parent` `t1` +WHERE + `t1`.`ParentID` < 0 + diff --git a/MySql.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySql.8.0).sql b/MySql.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySql.8.0).sql new file mode 100644 index 000000000000..5a5d40b80518 --- /dev/null +++ b/MySql.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySql.8.0).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + ( + SELECT + MIN(`a_Children`.`ParentID`) + FROM + `Child` `a_Children` + WHERE + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ParentID` < 0 + ) +FROM + `Parent` `p` + diff --git a/MySql.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0).sql b/MySql.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0).sql index 7c6536368030..f90a0c1de4ed 100644 --- a/MySql.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0).sql +++ b/MySql.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySql.8.0).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ `p`.`ParentID`, `p`.`Value1`, - `t1`.`COUNT_1` + `t1`.`Count_1` FROM ( SELECT /*+ QB_NAME(Inline) */ `c_1`.`ParentID`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY diff --git a/MySql.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0).sql index cdc996792b09..6fadd1032db4 100644 --- a/MySql.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySql.8.0).sql @@ -25,5 +25,5 @@ FROM GROUP BY `tt`.`Key_1` HAVING - SUM(`tt`.`ID`) <> 0 + SUM(`tt`.`ID`) <> 0 OR SUM(`tt`.`ID`) IS NULL diff --git a/MySql.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0,False).sql b/MySql.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0,False).sql index b1846aee426f..d7b7b4c39719 100644 --- a/MySql.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0,False).sql +++ b/MySql.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySql.8.0,False).sql @@ -2,27 +2,23 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` IN (@In, @In_1) + `s`.`CEnum` IN (@In, @In) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` NOT IN (@NotIn, @NotIn_1) + `s`.`CEnum` NOT IN (@NotIn, @NotIn) diff --git a/MySql.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0).sql b/MySql.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0).sql index f1eaf883f8c5..67b203d40de5 100644 --- a/MySql.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySql.8.0).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `p`.`ID` + CAST(CAST(`p`.`ID` AS UNSIGNED) AS CHAR(3)) FROM `LinqDataTypes` `p` WHERE diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0).sql index 6d3f03000c48..e4625123e440 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySql.8.0).sql @@ -11,7 +11,7 @@ FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` - ) `g_2` + ) `t1` WHERE - `g_2`.`ParentID` > 2 + `t1`.`ParentID` > 2 diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0).sql index bc7574f1a079..3ed806f8f4cc 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySql.8.0).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0).sql index ca4f1e28d3de..5d91afa81b4c 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySql.8.0).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0).sql index ebb05f8abff8..a129bf375149 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySql.8.0).sql @@ -2,22 +2,22 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0).sql index ebb05f8abff8..a129bf375149 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySql.8.0).sql @@ -2,22 +2,22 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0).sql index aae2d4608790..16860600995a 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySql.8.0).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1` + END) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 OR `g_2`.`Key_1` > 2 + `g_2`.`Count_1` > 2 OR `g_2`.`Key_1` > 2 diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0).sql index e882413c3746..bd8bf4870118 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySql.8.0).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`Key_1` < 5 + `g_2`.`Count_1` > 2 AND `g_2`.`Key_1` < 5 diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0).sql index a5e10f7ddb84..178533672df5 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySql.8.0).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 3 OR `g_2`.`Key_1` = 1 + `g_2`.`Count_1` > 3 OR `g_2`.`Key_1` = 1 diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0).sql index 50f6fe246c96..d36600f74cb4 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySql.8.0).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t2`.`COUNT_1` + `t2`.`COUNT_1` + `t2`.`Count_1` + `t2`.`Count_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM `Child` `c_1` WHERE `t1`.`ParentID` = `c_1`.`ParentID` - ) as `COUNT_1` + ) as `Count_1` FROM `Parent` `t1` ) `t2` diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0).sql index d84f98867eef..019940e365ff 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySql.8.0).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0).sql b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0).sql index d84f98867eef..019940e365ff 100644 --- a/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySql.8.0).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySql.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0).sql b/MySql.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0).sql index b7d98f773c35..b2766771699a 100644 --- a/MySql.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySql.8.0).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t2`.`SUM_1` + `t2`.`Sum_1` FROM `Parent` `p` LEFT JOIN LATERAL ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN `d`.`ParentID` IS NOT NULL THEN `d`.`ParentID` ELSE -100 - END) as `SUM_1` + END) as `Sum_1` FROM ( SELECT diff --git a/MySql.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0).sql b/MySql.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0).sql new file mode 100644 index 000000000000..a39e92556556 --- /dev/null +++ b/MySql.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySql.8.0).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0).sql b/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0).sql index 3600bf680f2c..1f2dfb379524 100644 --- a/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySql.8.0).sql @@ -2,13 +2,13 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t3`.`SUM_1`, - `t6`.`COUNT_1` + `t3`.`Sum_1`, + `t6`.`Count_1` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - SUM(`t2`.`DetailId`) as `SUM_1` + SUM(`t2`.`DetailId`) as `Sum_1` FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) `t3` ON 1=1 LEFT JOIN LATERAL ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM ( SELECT diff --git a/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0).sql b/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0).sql index 89af725414f2..7f686bb0c9a1 100644 --- a/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySql.8.0).sql @@ -2,12 +2,12 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t3`.`AVG_1` + `t3`.`Average` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `AVG_1` + AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `Average` FROM ( SELECT diff --git a/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySql.8.0).sql b/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySql.8.0).sql index 11624c68b565..c51f19f6b8ba 100644 --- a/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySql.8.0).sql @@ -2,7 +2,6 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `it_1`.`cond_1`, `it_1`.`cond`, `it_1`.`ColorName`, `it_1`.`StyleName`, @@ -17,7 +16,7 @@ FROM LEFT JOIN `SomeStyle` `a_Style` ON `t3`.`StyleId` = `a_Style`.`Id` LEFT JOIN ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `SomeItem` `t1` ) `t2` ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT `it`.`ColorName`, `it`.`Count` as `Count_1`, - `it`.`index` as `cond`, `it`.`StyleName`, `it`.`Conditional`, `it`.`field1`, `it`.`field2`, `it`.`field3`, - 1 as `cond_1` + 1 as `cond` FROM ( - SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`COUNT_1` AS `Count`, 0 AS `index`, `a_Style`.`Name` AS `StyleName`, CASE - WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`COUNT_1` + SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`Count_1` AS `Count`, `a_Style`.`Name` AS `StyleName`, CASE + WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`Count_1` ELSE 0 END AS `Conditional`, 1 AS `field1`, 2 AS `field2`, 3 AS `field3` UNION ALL - SELECT NULL, 0, 1, `a_Style`.`Name`, NULL, 4, 5, 6) `it` + SELECT NULL, 0, `a_Style`.`Name`, NULL, 4, 5, 6) `it` ) `it_1` ON 1=1 WHERE `it_1`.`ColorName` = 'Red' OR `it_1`.`Count_1` = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN `SomeColor` `a_Color` ON `t3`.`ColorId` = `a_Color`.`Id` LEFT JOIN ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `SomeItem` `t1` ) `t2` ON 1=1 LEFT JOIN LATERAL ( - SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`COUNT_1` AS `Count`, CASE - WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`COUNT_1` + SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`Count_1` AS `Count`, CASE + WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`Count_1` ELSE 0 END AS `Conditional` UNION ALL diff --git a/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySql.8.0).sql b/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySql.8.0).sql index 8cd77970e4ae..86716f0ea9ba 100644 --- a/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySql.8.0).sql @@ -20,7 +20,7 @@ FROM ( SELECT `a_Color`.`Name` AS `ColorName`, `a_Style`.`Name` AS `StyleName`, ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `SomeItem` `t1` ) AS `Count` diff --git a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0).sql b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0).sql index a01b5dc2cd8f..29997471e524 100644 --- a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySql.8.0).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 0 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 0 ) FROM `Parent` `p` diff --git a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0).sql b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0).sql index 675703916356..29a2f54c04dc 100644 --- a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySql.8.0).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 1 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 1 ) FROM `Parent` `p` diff --git a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0).sql b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0).sql index 1fe8955fa05b..b1b9584d4332 100644 --- a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySql.8.0).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 2 FROM `Parent` `p` diff --git a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0).sql b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0).sql index ee275e3fbf82..110bfc062fac 100644 --- a/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySql.8.0).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 4 FROM `Parent` `p` diff --git a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0).sql b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0).sql index fe0c90495d4a..2a657d9ddec5 100644 --- a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySql.8.0).sql @@ -2,97 +2,41 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t7`.`Key_1`, - `t7`.`COUNT_1`, - `t7`.`COUNT_2`, - `t7`.`COUNT_3`, - `t7`.`COUNT_4`, - `t1`.`COUNT_1`, - `t3`.`COUNT_1`, - `t4`.`COUNT_1`, - `t7`.`COUNT_5`, - `t6`.`COUNT_1` + `t`.`GroupId`, + COUNT(*), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT `t`.`DataValue`), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT `t`.`DataValue`) FROM - ( - SELECT - `t`.`GroupId` as `Key_1`, - COUNT(*) as `COUNT_1`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_2`, - COUNT(*) as `COUNT_3`, - COUNT(DISTINCT `t`.`DataValue`) as `COUNT_4`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_5` - FROM - `AggregationData` `t` - WHERE - `t`.`DataValue` IS NOT NULL - GROUP BY - `t`.`GroupId` - ) `t7` - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x`.`DataValue` - FROM - `AggregationData` `x` - WHERE - `x`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x`.`GroupId` - ) `x_1` - WHERE - `x_1`.`DataValue` % 2 = 0 - ) `t1` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_1`.`DataValue` - FROM - `AggregationData` `t_1` - WHERE - `t_1`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_1`.`GroupId` AND - `t_1`.`DataValue` % 2 = 0 - ) `t2` - ) `t3` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x_2`.`DataValue` - FROM - `AggregationData` `x_2` - WHERE - `x_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x_2`.`GroupId` AND - `x_2`.`DataValue` % 2 = 0 - ) `x_3` - WHERE - `x_3`.`DataValue` % 2 = 0 - ) `t4` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_2`.`DataValue` - FROM - `AggregationData` `t_2` - WHERE - `t_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_2`.`GroupId` AND - `t_2`.`DataValue` % 2 = 0 - ) `t5` - ) `t6` ON 1=1 + `AggregationData` `t` +WHERE + `t`.`DataValue` IS NOT NULL +GROUP BY + `t`.`GroupId` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 diff --git a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0).sql b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0).sql index aa6741a876d1..0a5c9b7f174f 100644 --- a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySql.8.0).sql @@ -7,7 +7,7 @@ FROM ( SELECT `a_Parent`.`ParentID`, - COUNT(*) as `COUNT_1`, + COUNT(*) as `Count_1`, `a_Parent`.`Value1` FROM `GrandChild` `g_1` @@ -17,5 +17,5 @@ FROM `a_Parent`.`Value1` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`ParentID` <> 1 + `g_2`.`Count_1` > 2 AND `g_2`.`ParentID` <> 1 diff --git a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0).sql b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0).sql index 8de012a19391..ba562a4e9632 100644 --- a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySql.8.0).sql @@ -2,23 +2,23 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `g_2`.`MIN_2` + `g_2`.`Min_2` FROM ( SELECT MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1`, + END) as `Min_1`, MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_2` + END) as `Min_2` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`MIN_1` IS NOT NULL + `g_2`.`Min_1` IS NOT NULL diff --git a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0).sql b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0).sql index 2fa9fe1ba0f2..cbcb16080746 100644 --- a/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySql.8.0).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `g_2`.`MIN_1` + `g_2`.`Min_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1` + END) as `Min_1` FROM `Child` `g_1` GROUP BY diff --git a/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,5).sql b/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,5).sql index 99d7b8e1f5e2..a7860ae0f741 100644 --- a/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,5).sql +++ b/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,5).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 @@ -10,5 +10,5 @@ BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` diff --git a/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,6).sql b/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,6).sql index 760653d04ee0..12d16c2fa61c 100644 --- a/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,6).sql +++ b/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,6).sql @@ -2,13 +2,13 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,null).sql b/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,null).sql index 760653d04ee0..12d16c2fa61c 100644 --- a/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,null).sql +++ b/MySql.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySql.8.0,null).sql @@ -2,13 +2,13 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0).sql b/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0).sql index 6086afbdf167..557d9e299338 100644 --- a/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySql.8.0).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertKey`, `al_group_2`.`AlertCode`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0).sql b/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0).sql index d6d3a56b91a7..09ee86efba77 100644 --- a/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySql.8.0).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertCode`, `al_group_2`.`AlertKey`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0).sql index 5b2c98954404..a67f318e0ab0 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySql.8.0).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0).sql index ba8d825b6d9a..a5edd0ed624f 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySql.8.0).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0).sql index 2d2725b4b78f..aac6bffa6000 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySql.8.0).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,1).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,1).sql index ed3f871e36af..6f5616dff8f9 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,1).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,2).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,2).sql index ed3f871e36af..6f5616dff8f9 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,2).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,1).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,1).sql index ba8d825b6d9a..a5edd0ed624f 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,1).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,1).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,2).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,2).sql index ba8d825b6d9a..a5edd0ed624f 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,2).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySql.8.0,ToEven,2).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0).sql index 5b2c98954404..a67f318e0ab0 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySql.8.0).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0).sql index ba8d825b6d9a..a5edd0ed624f 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySql.8.0).sql @@ -2,7 +2,7 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0).sql index 2d2725b4b78f..aac6bffa6000 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySql.8.0).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0).sql index 71ccf7c5f0c3..ca96b8f4f439 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySql.8.0).sql @@ -2,9 +2,14 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0).sql index 71ccf7c5f0c3..ca96b8f4f439 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySql.8.0).sql @@ -2,9 +2,14 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0).sql index 5b2c98954404..a67f318e0ab0 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySql.8.0).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0).sql index 5b2c98954404..a67f318e0ab0 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySql.8.0).sql @@ -2,13 +2,18 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0).sql b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0).sql index 5bed0362e4e8..ce661e793095 100644 --- a/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySql.8.0).sql @@ -2,9 +2,14 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`, 1) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`, 1) <> 0 + `t`.`c1` <> 0 diff --git a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0).sql b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0).sql index 33af313afe77..0df1ed2e05a0 100644 --- a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySql.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0).sql b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0).sql index 33af313afe77..0df1ed2e05a0 100644 --- a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySql.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0).sql b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0).sql index f381a56adb07..26bb8e4c85fe 100644 --- a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySql.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0).sql b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0).sql index f381a56adb07..26bb8e4c85fe 100644 --- a/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySql.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySql.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0).sql b/MySql.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0).sql index e1373e673e2e..f9c3ffa68d43 100644 --- a/MySql.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySql.8.0).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), `x`.`Key_1`, `x`.`Count_1`, - `x`.`MAX_1` + `x`.`Max_1` FROM ( SELECT `summary`.`LastName` as `Key_1`, COUNT(*) as `Count_1`, - MAX(`summary`.`FirstName`) as `MAX_1` + MAX(`summary`.`FirstName`) as `Max_1` FROM `Person` `summary` GROUP BY diff --git a/MySql.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySql.8.0).sql index b16718186769..179edd96e953 100644 --- a/MySql.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySql.8.0).sql @@ -5,6 +5,8 @@ SELECT CONCAT_WS(' -> ', `t`.`Value2`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -13,6 +15,8 @@ SELECT CONCAT_WS(' -> ', `t`.`Value3`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value1`, `t`.`Value2`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` BeforeExecute -- MySql.8.0 MySql.8.0.MySql.Data MySql80 @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value3`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySql.8.0).sql new file mode 100644 index 000000000000..42d861c7e71a --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySql.8.0).sql @@ -0,0 +1,52 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + CONCAT_WS(', ', Coalesce(`t`.`NullableValue`, ''), `t`.`NotNullableValue`, Coalesce(`t`.`VarcharValue`, ''), Coalesce(`t`.`NVarcharValue`, '')), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT CASE + WHEN `t2`.`item` <> 'A' OR `t2`.`item` IS NULL THEN Coalesce(`t2`.`item`, '') + ELSE NULL + END ORDER BY CASE + WHEN `t2`.`item` IS NULL THEN 0 + ELSE 1 + END, `t2`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t2` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySql.8.0).sql new file mode 100644 index 000000000000..2801e267449b --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySql.8.0).sql @@ -0,0 +1,33 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + CONCAT_WS(', ', `t`.`NullableValue`, `t`.`NotNullableValue`, `t`.`VarcharValue`, `t`.`NVarcharValue`), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`VarcharValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySql.8.0).sql new file mode 100644 index 000000000000..3efe1f5d9d19 --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySql.8.0).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`c1` +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN LOCATE('A', `t`.`NullableValue`) > 0 THEN `t`.`NullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NotNullableValue`) > 0 THEN `t`.`NotNullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`VarcharValue`) > 0 THEN `t`.`VarcharValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NVarcharValue`) > 0 THEN `t`.`NVarcharValue` + ELSE NULL + END) as `c1` + FROM + `SampleClass` `t` + ) `x` +WHERE + `x`.`c1` RLIKE '[^ + …             

  ]' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySql.8.0).sql new file mode 100644 index 000000000000..b7fafd559e6d --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySql.8.0).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySql.8.0).sql new file mode 100644 index 000000000000..2ff2eb1572af --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySql.8.0).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySql.8.0).sql new file mode 100644 index 000000000000..c600cd46f56a --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySql.8.0).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySql.8.0).sql new file mode 100644 index 000000000000..2f0a73af5518 --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySql.8.0).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySql.8.0).sql new file mode 100644 index 000000000000..1ab548aa5e35 --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySql.8.0).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t5`.`Key_1`, + `t2`.`Join_1`, + `t4`.`Join_1` +FROM + ( + SELECT + `g_1`.`Id` as `Key_1` + FROM + `SampleClass` `g_1` + GROUP BY + `g_1`.`Id` + ) `t5` + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x`.`NullableValue` + FROM + `SampleClass` `x` + WHERE + `t5`.`Key_1` = `x`.`Id` + ORDER BY + `x`.`NotNullableValue` + LIMIT 2 + ) `t1` + ) `t2` ON 1=1 + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(`t3`.`NotNullableValue` SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x_1`.`NotNullableValue` + FROM + `SampleClass` `x_1` + WHERE + `t5`.`Key_1` = `x_1`.`Id` + ORDER BY + `x_1`.`NotNullableValue` + LIMIT 2 + ) `t3` + ) `t4` ON 1=1 +ORDER BY + `t5`.`Key_1` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySql.8.0).sql new file mode 100644 index 000000000000..e5dd9a55cc26 --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySql.8.0).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') ORDER BY Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySql.8.0).sql new file mode 100644 index 000000000000..2baa1f1cd7cb --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySql.8.0).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(`g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySql.8.0).sql new file mode 100644 index 000000000000..3e574ca4371e --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySql.8.0).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), + Coalesce(GROUP_CONCAT(CASE + WHEN `g_1`.`NullableValue` <> '' THEN `g_1`.`NullableValue` + ELSE NULL + END ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY CASE + WHEN `g_1`.`NullableValue` IS NULL THEN 0 + ELSE 1 + END, `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySql.8.0).sql b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySql.8.0).sql new file mode 100644 index 000000000000..d8c95e61098b --- /dev/null +++ b/MySql.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySql.8.0).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` SEPARATOR ', '), ''), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` SEPARATOR ', '), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0).sql b/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0).sql index 4d11976eb9ff..a452c04d0e6a 100644 --- a/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySql.8.0).sql @@ -9,30 +9,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute DisposeTransaction diff --git a/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0).sql b/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0).sql index ab2a82d21c63..06df7afc8214 100644 --- a/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySql.8.0).sql @@ -9,30 +9,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute DisposeTransaction diff --git a/MySql.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0).sql b/MySql.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0).sql index a411bbda5140..9e4c312c2078 100644 --- a/MySql.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0).sql +++ b/MySql.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySql.8.0).sql @@ -2,12 +2,12 @@ -- MySql.8.0 MySql.8.0.MySql.Data MySql80 SELECT - `g_1`.`COUNT_1` + `g_1`.`Count_1` FROM ( SELECT `c_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY @@ -16,5 +16,5 @@ FROM `c_1`.`ParentID` > 1 ) `g_1` WHERE - `g_1`.`Key_1` > 1 AND `g_1`.`COUNT_1` > 1 + `g_1`.`Key_1` > 1 AND `g_1`.`Count_1` > 1 diff --git a/MySql.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/MySql.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index ceed53ef0558..f455e6af26aa 100644 --- a/MySql.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/MySql.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySql.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT `d`.`ValB`, `d`.`ValInt` FROM - ( - SELECT DISTINCT - `l1`.`ID`, - `l1`.`ValS` + `Issue3757Level1` `m_1` + INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` +WHERE + EXISTS( + SELECT + * FROM - `Issue3757Level1` `l1` + `Issue3757Level2` `c_1` WHERE - EXISTS( - SELECT - * - FROM - `Issue3757Level2` `c_1` - WHERE - `l1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `l1`.`ValS`) > 0 AND - `l1`.`ValS` IS NOT NULL - ) - ) `m_1` - INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` + `m_1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `m_1`.`ValS`) > 0 AND + `m_1`.`ValS` IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0).sql index 676cfe3d592d..3de120f5c186 100644 --- a/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySql.8.0).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x_1`.`ParentID`, `x_1`.`CountResult`, - `x_1`.`SUM_1` + `x_1`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `od_1` WHERE `x`.`ParentID` = `od_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `x` ) `x_1` diff --git a/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0).sql index 9c89fcf9e2fd..e5fab89e7703 100644 --- a/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySql.8.0).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x`.`ParentID`, `x`.`CountResult`, - `x`.`SUM_1` + `x`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `a_Children_1` WHERE `o`.`ParentID` = `a_Children_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `o` ) `x` diff --git a/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(MySql.8.0).sql index 2ee88d4958b5..b02b39dd938e 100644 --- a/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(MySql.8.0).sql @@ -9,17 +9,12 @@ SELECT `d`.`ChildID` FROM ( - SELECT DISTINCT - `t2`.`ParentID` + SELECT + `a_Parent`.`ParentID` FROM - ( - SELECT - `a_Parent`.`ParentID` - FROM - `Child` `t1` - LEFT JOIN `Parent` `a_Parent` ON `t1`.`ParentID` = `a_Parent`.`ParentID` - LIMIT 1 - ) `t2` + `Child` `t1` + LEFT JOIN `Parent` `a_Parent` ON `t1`.`ParentID` = `a_Parent`.`ParentID` + LIMIT 1 ) `m_1` INNER JOIN `Child` `d` ON `m_1`.`ParentID` = `d`.`ParentID` diff --git a/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySql.8.0).sql index 2ee88d4958b5..b02b39dd938e 100644 --- a/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySql.8.0).sql @@ -9,17 +9,12 @@ SELECT `d`.`ChildID` FROM ( - SELECT DISTINCT - `t2`.`ParentID` + SELECT + `a_Parent`.`ParentID` FROM - ( - SELECT - `a_Parent`.`ParentID` - FROM - `Child` `t1` - LEFT JOIN `Parent` `a_Parent` ON `t1`.`ParentID` = `a_Parent`.`ParentID` - LIMIT 1 - ) `t2` + `Child` `t1` + LEFT JOIN `Parent` `a_Parent` ON `t1`.`ParentID` = `a_Parent`.`ParentID` + LIMIT 1 ) `m_1` INNER JOIN `Child` `d` ON `m_1`.`ParentID` = `d`.`ParentID` diff --git a/MySql.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0).sql index 40bf2854df12..321c220152c1 100644 --- a/MySql.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySql.8.0).sql @@ -20,7 +20,7 @@ FROM `vpc`.`CategoryId`, `pop`.`ProductId`, COALESCE(`pcc`.`PeriodOrderLimit`,0) as `MaxCapacity`, - COALESCE(COALESCE(`vsp`.`SUM_1`,0),0) as `Quantity` + COALESCE(COALESCE(`vsp`.`Quantity`,0),0) as `Quantity` FROM `OrderPeriod` `op` INNER JOIN `ProductsPerOrderPeriod` `pop` ON `op`.`Id` = `pop`.`OrderPeriodId` @@ -30,7 +30,7 @@ FROM SELECT `agroup`.`Id`, `oi`.`ProductId`, - SUM(COALESCE(`oi`.`Quantity`,0)) as `SUM_1` + SUM(COALESCE(`oi`.`Quantity`,0)) as `Quantity` FROM `OrderPeriod` `agroup` LEFT JOIN `OrderHeader` `oh` ON `agroup`.`Id` = `oh`.`PeriodId` diff --git a/MySql.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0).sql index 58e796210390..5c3d746a6151 100644 --- a/MySql.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySql.8.0).sql @@ -3,7 +3,7 @@ SELECT Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11))), - `t1`.`SUM_1`, + `t1`.`SubSum`, EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN `Parent` `a_Parent` ON `c_1`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = `f`.`ParentID` AND (`a_Parent`.`Value1` = `f`.`Value1` OR `a_Parent`.`Value1` IS NULL AND `f`.`Value1` IS NULL) - ) as `SUM_1`, + ) as `SubSum`, `f`.`ParentID` FROM `Parent` `f` ) `t1` WHERE LOCATE('1', Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11)))) > 0 AND - `t1`.`SUM_1` > 0 + `t1`.`SubSum` > 0 diff --git a/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0).sql index adb253d5fea8..619c916abefe 100644 --- a/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySql.8.0).sql @@ -5,13 +5,13 @@ SELECT `p1`.`ParentID`, `p1`.`Value1`, `p2`.`Key_1`, - `p2`.`SUM_1` + `p2`.`Sum_1` FROM `Parent` `p1` INNER JOIN ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0).sql index bd526c9116f9..97d2bd19997c 100644 --- a/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0).sql +++ b/MySql.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySql.8.0).sql @@ -3,14 +3,14 @@ SELECT `t1`.`Key_1`, - `t1`.`SUM_1`, + `t1`.`Sum_1`, `p2`.`Key_1`, `p2`.`Sum_1` FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0).sql b/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0).sql index 495b44db4cb1..fbb53714e336 100644 --- a/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0).sql +++ b/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySql.8.0).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0).sql b/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0).sql index 495b44db4cb1..fbb53714e336 100644 --- a/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0).sql +++ b/MySql.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySql.8.0).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql b/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql index d2f5f1f5af88..8586cf0cdac9 100644 --- a/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql @@ -6,14 +6,14 @@ SELECT `m_1`.`Id`, `d_1`.`Key_1`, - `d_1`.`SUM_1`, + `d_1`.`Sum_1`, `d_1`.`Issue4626AnyValue` FROM `Parents` `m_1` INNER JOIN LATERAL ( SELECT `d`.`ParentId` as `Key_1`, - SUM(`d`.`Id`) as `SUM_1`, + SUM(`d`.`Id`) as `Sum_1`, ANY_VALUE(`d`.`Name`) as `Issue4626AnyValue` FROM `Children` `d` diff --git a/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql index f271add1539b..112c4f075bbb 100644 --- a/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql @@ -6,14 +6,14 @@ SELECT `m_1`.`Id`, `d_1`.`Key_1`, - `d_1`.`SUM_1`, + `d_1`.`Sum_1`, `d_1`.`ToValue` FROM `Parents` `m_1` INNER JOIN LATERAL ( SELECT `d`.`ParentId` as `Key_1`, - SUM(`d`.`Id`) as `SUM_1`, + SUM(`d`.`Id`) as `Sum_1`, GROUP_CONCAT(`d`.`Name` SEPARATOR ', ') as `ToValue` FROM `Children` `d` diff --git a/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql b/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql index d2f5f1f5af88..8586cf0cdac9 100644 --- a/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(MySqlConnector.8.0).sql @@ -6,14 +6,14 @@ SELECT `m_1`.`Id`, `d_1`.`Key_1`, - `d_1`.`SUM_1`, + `d_1`.`Sum_1`, `d_1`.`Issue4626AnyValue` FROM `Parents` `m_1` INNER JOIN LATERAL ( SELECT `d`.`ParentId` as `Key_1`, - SUM(`d`.`Id`) as `SUM_1`, + SUM(`d`.`Id`) as `Sum_1`, ANY_VALUE(`d`.`Name`) as `Issue4626AnyValue` FROM `Children` `d` diff --git a/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql index f271add1539b..112c4f075bbb 100644 --- a/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(MySqlConnector.8.0).sql @@ -6,14 +6,14 @@ SELECT `m_1`.`Id`, `d_1`.`Key_1`, - `d_1`.`SUM_1`, + `d_1`.`Sum_1`, `d_1`.`ToValue` FROM `Parents` `m_1` INNER JOIN LATERAL ( SELECT `d`.`ParentId` as `Key_1`, - SUM(`d`.`Id`) as `SUM_1`, + SUM(`d`.`Id`) as `Sum_1`, GROUP_CONCAT(`d`.`Name` SEPARATOR ', ') as `ToValue` FROM `Children` `d` diff --git a/MySqlConnector.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..19f1ef27381c --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + MIN(`t1`.`ParentID`) +FROM + `Parent` `t1` +WHERE + `t1`.`ParentID` < 0 + diff --git a/MySqlConnector.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..0102ce2c7a7b --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + ( + SELECT + MIN(`a_Children`.`ParentID`) + FROM + `Child` `a_Children` + WHERE + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ParentID` < 0 + ) +FROM + `Parent` `p` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0.LinqService).sql index ade72b219de4..41ccaea999a3 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0.LinqService).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ `p`.`ParentID`, `p`.`Value1`, - `t1`.`COUNT_1` + `t1`.`Count_1` FROM ( SELECT /*+ QB_NAME(Inline) */ `c_1`.`ParentID`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0.LinqService).sql index c4cf73ddaa67..5fc49fa18b5a 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY `tt`.`Key_1` HAVING - SUM(`tt`.`ID`) <> 0 + SUM(`tt`.`ID`) <> 0 OR SUM(`tt`.`ID`) IS NULL diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0.LinqService,False).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0.LinqService,False).sql index 5ef65e4dd72e..2164849e239d 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0.LinqService,False).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0.LinqService,False).sql @@ -2,27 +2,23 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` IN (@In, @In_1) + `s`.`CEnum` IN (@In, @In) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` NOT IN (@NotIn, @NotIn_1) + `s`.`CEnum` NOT IN (@NotIn, @NotIn) diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0.LinqService).sql index e4e99690d47d..1821531d2dab 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `p`.`ID` + CAST(CAST(`p`.`ID` AS UNSIGNED) AS CHAR(3)) FROM `LinqDataTypes` `p` WHERE diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0.LinqService).sql index 5747fcf868c8..097925139d94 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0.LinqService).sql @@ -11,7 +11,7 @@ FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` - ) `g_2` + ) `t1` WHERE - `g_2`.`ParentID` > 2 + `t1`.`ParentID` > 2 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0.LinqService).sql index 706884c6396f..4357bd69d11c 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0.LinqService).sql index 7779c7fbd9cc..40a489772de1 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0.LinqService).sql index 39bcf0f4a241..cca1bac6f834 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0.LinqService).sql @@ -2,22 +2,22 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0.LinqService).sql index 39bcf0f4a241..cca1bac6f834 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0.LinqService).sql @@ -2,22 +2,22 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0.LinqService).sql index 2be80dee9af4..a72648b3114d 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1` + END) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 OR `g_2`.`Key_1` > 2 + `g_2`.`Count_1` > 2 OR `g_2`.`Key_1` > 2 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0.LinqService).sql index ed056940d8aa..daa6968a7e65 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`Key_1` < 5 + `g_2`.`Count_1` > 2 AND `g_2`.`Key_1` < 5 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0.LinqService).sql index 3f153a82a554..669e9c926eb2 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 3 OR `g_2`.`Key_1` = 1 + `g_2`.`Count_1` > 3 OR `g_2`.`Key_1` = 1 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0.LinqService).sql index fd20866d2f6a..2bb1b3b2732b 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t2`.`COUNT_1` + `t2`.`COUNT_1` + `t2`.`Count_1` + `t2`.`Count_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM `Child` `c_1` WHERE `t1`.`ParentID` = `c_1`.`ParentID` - ) as `COUNT_1` + ) as `Count_1` FROM `Parent` `t1` ) `t2` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0.LinqService).sql index b3bffea79bf5..e016f858fbc2 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0.LinqService).sql index b3bffea79bf5..e016f858fbc2 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0.LinqService).sql index 5cf47c75c61d..de536f6f52b1 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t2`.`SUM_1` + `t2`.`Sum_1` FROM `Parent` `p` LEFT JOIN LATERAL ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN `d`.`ParentID` IS NOT NULL THEN `d`.`ParentID` ELSE -100 - END) as `SUM_1` + END) as `Sum_1` FROM ( SELECT diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..81287dca20fd --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0.LinqService).sql index 19fbc725cdca..c77a830d8b5d 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0.LinqService).sql @@ -2,13 +2,13 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t3`.`SUM_1`, - `t6`.`COUNT_1` + `t3`.`Sum_1`, + `t6`.`Count_1` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - SUM(`t2`.`DetailId`) as `SUM_1` + SUM(`t2`.`DetailId`) as `Sum_1` FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) `t3` ON 1=1 LEFT JOIN LATERAL ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM ( SELECT diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0.LinqService).sql index 94cb09f3c621..57edbebb5230 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0.LinqService).sql @@ -2,12 +2,12 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t3`.`AVG_1` + `t3`.`Average` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `AVG_1` + AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `Average` FROM ( SELECT diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0.LinqService).sql index 6e5345d22c61..b85ec81cccc4 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 0 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 0 ) FROM `Parent` `p` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0.LinqService).sql index 2a160309d964..5b4f198ef60d 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 1 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 1 ) FROM `Parent` `p` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0.LinqService).sql index 0129098df210..7dfd8da52683 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 2 FROM `Parent` `p` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0.LinqService).sql index a8057b45b371..65a56fecf350 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 4 FROM `Parent` `p` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0.LinqService).sql index cba9f2516e53..6c21d54c577c 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0.LinqService).sql @@ -2,97 +2,41 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t7`.`Key_1`, - `t7`.`COUNT_1`, - `t7`.`COUNT_2`, - `t7`.`COUNT_3`, - `t7`.`COUNT_4`, - `t1`.`COUNT_1`, - `t3`.`COUNT_1`, - `t4`.`COUNT_1`, - `t7`.`COUNT_5`, - `t6`.`COUNT_1` + `t`.`GroupId`, + COUNT(*), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT `t`.`DataValue`), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT `t`.`DataValue`) FROM - ( - SELECT - `t`.`GroupId` as `Key_1`, - COUNT(*) as `COUNT_1`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_2`, - COUNT(*) as `COUNT_3`, - COUNT(DISTINCT `t`.`DataValue`) as `COUNT_4`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_5` - FROM - `AggregationData` `t` - WHERE - `t`.`DataValue` IS NOT NULL - GROUP BY - `t`.`GroupId` - ) `t7` - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x`.`DataValue` - FROM - `AggregationData` `x` - WHERE - `x`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x`.`GroupId` - ) `x_1` - WHERE - `x_1`.`DataValue` % 2 = 0 - ) `t1` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_1`.`DataValue` - FROM - `AggregationData` `t_1` - WHERE - `t_1`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_1`.`GroupId` AND - `t_1`.`DataValue` % 2 = 0 - ) `t2` - ) `t3` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x_2`.`DataValue` - FROM - `AggregationData` `x_2` - WHERE - `x_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x_2`.`GroupId` AND - `x_2`.`DataValue` % 2 = 0 - ) `x_3` - WHERE - `x_3`.`DataValue` % 2 = 0 - ) `t4` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_2`.`DataValue` - FROM - `AggregationData` `t_2` - WHERE - `t_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_2`.`GroupId` AND - `t_2`.`DataValue` % 2 = 0 - ) `t5` - ) `t6` ON 1=1 + `AggregationData` `t` +WHERE + `t`.`DataValue` IS NOT NULL +GROUP BY + `t`.`GroupId` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0.LinqService).sql index 0e01cf6012c3..08b0c6d6be35 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT `a_Parent`.`ParentID`, - COUNT(*) as `COUNT_1`, + COUNT(*) as `Count_1`, `a_Parent`.`Value1` FROM `GrandChild` `g_1` @@ -17,5 +17,5 @@ FROM `a_Parent`.`Value1` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`ParentID` <> 1 + `g_2`.`Count_1` > 2 AND `g_2`.`ParentID` <> 1 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0.LinqService).sql index ca69f18c098f..04792ff26390 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0.LinqService).sql @@ -2,23 +2,23 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `g_2`.`MIN_2` + `g_2`.`Min_2` FROM ( SELECT MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1`, + END) as `Min_1`, MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_2` + END) as `Min_2` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`MIN_1` IS NOT NULL + `g_2`.`Min_1` IS NOT NULL diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0.LinqService).sql index 7265883dee28..254707f47c72 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `g_2`.`MIN_1` + `g_2`.`Min_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1` + END) as `Min_1` FROM `Child` `g_1` GROUP BY diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,5).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,5).sql index 13dfce4a0c0d..2d25640bed30 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,5).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,5).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 @@ -10,5 +10,5 @@ BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,6).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,6).sql index 5452afb36b87..7821faa164bf 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,6).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,6).sql @@ -2,13 +2,13 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,null).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,null).sql index 5452afb36b87..7821faa164bf 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,null).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0.LinqService,null).sql @@ -2,13 +2,13 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0.LinqService).sql index f4ff92bccb7f..81559bb1df63 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0.LinqService).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertKey`, `al_group_2`.`AlertCode`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0.LinqService).sql index 0b3c3aa42764..0eed654936b7 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0.LinqService).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertCode`, `al_group_2`.`AlertKey`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0.LinqService).sql index 13fe7db07d92..37b5a14c8fcc 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0.LinqService).sql index 885772fb1841..b68c6bd46754 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0.LinqService).sql index 134fb7e236f9..51e0e10b4974 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,1).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,1).sql index 41928e464125..ada6b135ac37 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,1).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,2).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,2).sql index 41928e464125..ada6b135ac37 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,2).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,1).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,1).sql index 885772fb1841..b68c6bd46754 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,1).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,2).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,2).sql index 885772fb1841..b68c6bd46754 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,2).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0.LinqService).sql index 13fe7db07d92..37b5a14c8fcc 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0.LinqService).sql index 885772fb1841..b68c6bd46754 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0.LinqService).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0.LinqService).sql index 134fb7e236f9..51e0e10b4974 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0.LinqService).sql index d0fa1c763747..747400d913f6 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0.LinqService).sql @@ -2,9 +2,14 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0.LinqService).sql index d0fa1c763747..747400d913f6 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0.LinqService).sql @@ -2,9 +2,14 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0.LinqService).sql index 13fe7db07d92..37b5a14c8fcc 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0.LinqService).sql index 13fe7db07d92..37b5a14c8fcc 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0.LinqService).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0.LinqService).sql index c3a10130e99f..2020700464e9 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0.LinqService).sql @@ -2,9 +2,14 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`, 1) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`, 1) <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0.LinqService).sql index b239e4b56a54..7e282a3f90d7 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0.LinqService).sql index b239e4b56a54..7e282a3f90d7 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0.LinqService).sql index 0c0fb7243ef8..b8974302f1e5 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0.LinqService).sql index 0c0fb7243ef8..b8974302f1e5 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0.LinqService).sql index eb510471fe67..1e3d1329cc28 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), `x`.`Key_1`, `x`.`Count_1`, - `x`.`MAX_1` + `x`.`Max_1` FROM ( SELECT `summary`.`LastName` as `Key_1`, COUNT(*) as `Count_1`, - MAX(`summary`.`FirstName`) as `MAX_1` + MAX(`summary`.`FirstName`) as `Max_1` FROM `Person` `summary` GROUP BY diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..4ff0ddb71687 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value2`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value3`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value1`, `t`.`Value2`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value3`) +FROM + `SampleClass` `t` +ORDER BY + `t`.`Id` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..433f013d1508 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,52 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(`t`.`NullableValue`, ''), `t`.`NotNullableValue`, Coalesce(`t`.`VarcharValue`, ''), Coalesce(`t`.`NVarcharValue`, '')), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT CASE + WHEN `t2`.`item` <> 'A' OR `t2`.`item` IS NULL THEN Coalesce(`t2`.`item`, '') + ELSE NULL + END ORDER BY CASE + WHEN `t2`.`item` IS NULL THEN 0 + ELSE 1 + END, `t2`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t2` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..a9c4bc7c8b2c --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,33 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + CONCAT_WS(', ', `t`.`NullableValue`, `t`.`NotNullableValue`, `t`.`VarcharValue`, `t`.`NVarcharValue`), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`VarcharValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..640bcdb3cd7b --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `x`.`c1` +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN LOCATE('A', `t`.`NullableValue`) > 0 THEN `t`.`NullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NotNullableValue`) > 0 THEN `t`.`NotNullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`VarcharValue`) > 0 THEN `t`.`VarcharValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NVarcharValue`) > 0 THEN `t`.`NVarcharValue` + ELSE NULL + END) as `c1` + FROM + `SampleClass` `t` + ) `x` +WHERE + `x`.`c1` RLIKE '[^ + …             

  ]' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..4663aae46771 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..7aae7eec4e24 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..7aae7eec4e24 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..824892e959a3 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..5ddf6732feb1 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t5`.`Key_1`, + `t2`.`Join_1`, + `t4`.`Join_1` +FROM + ( + SELECT + `g_1`.`Id` as `Key_1` + FROM + `SampleClass` `g_1` + GROUP BY + `g_1`.`Id` + ) `t5` + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x`.`NullableValue` + FROM + `SampleClass` `x` + WHERE + `t5`.`Key_1` = `x`.`Id` + ORDER BY + `x`.`NotNullableValue` + LIMIT 2 + ) `t1` + ) `t2` ON 1=1 + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(`t3`.`NotNullableValue` SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x_1`.`NotNullableValue` + FROM + `SampleClass` `x_1` + WHERE + `t5`.`Key_1` = `x_1`.`Id` + ORDER BY + `x_1`.`NotNullableValue` + LIMIT 2 + ) `t3` + ) `t4` ON 1=1 +ORDER BY + `t5`.`Key_1` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..bba27d49abc8 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') ORDER BY Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..342d4323a7bc --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(`g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..fdea7e6a395d --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), + Coalesce(GROUP_CONCAT(CASE + WHEN `g_1`.`NullableValue` <> '' THEN `g_1`.`NullableValue` + ELSE NULL + END ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY CASE + WHEN `g_1`.`NullableValue` IS NULL THEN 0 + ELSE 1 + END, `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySqlConnector.8.0.LinqService).sql new file mode 100644 index 000000000000..1b9a6bf0d045 --- /dev/null +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySqlConnector.8.0.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` SEPARATOR ', '), ''), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` SEPARATOR ', '), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0.LinqService).sql index 74b53fe5195f..c743dd6340d6 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0.LinqService).sql @@ -7,30 +7,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0.LinqService).sql index 59b8b82a09ca..db3fc4e0e82f 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0.LinqService).sql @@ -7,30 +7,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) diff --git a/MySqlConnector.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0.LinqService).sql index 49dba6b96eb5..87e12c62e6a8 100644 --- a/MySqlConnector.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0.LinqService).sql @@ -2,12 +2,12 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) SELECT - `g_1`.`COUNT_1` + `g_1`.`Count_1` FROM ( SELECT `c_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY @@ -16,5 +16,5 @@ FROM `c_1`.`ParentID` > 1 ) `g_1` WHERE - `g_1`.`Key_1` > 1 AND `g_1`.`COUNT_1` > 1 + `g_1`.`Key_1` > 1 AND `g_1`.`Count_1` > 1 diff --git a/MySqlConnector.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/MySqlConnector.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 1982b6559d77..c2b171dc72c8 100644 --- a/MySqlConnector.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/MySqlConnector.8.0.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT `d`.`ValB`, `d`.`ValInt` FROM - ( - SELECT DISTINCT - `l1`.`ID`, - `l1`.`ValS` + `Issue3757Level1` `m_1` + INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` +WHERE + EXISTS( + SELECT + * FROM - `Issue3757Level1` `l1` + `Issue3757Level2` `c_1` WHERE - EXISTS( - SELECT - * - FROM - `Issue3757Level2` `c_1` - WHERE - `l1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `l1`.`ValS`) > 0 AND - `l1`.`ValS` IS NOT NULL - ) - ) `m_1` - INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` + `m_1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `m_1`.`ValS`) > 0 AND + `m_1`.`ValS` IS NOT NULL + ) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) diff --git a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0.LinqService).sql index 56bf2aa1bb45..d7e9b5915139 100644 --- a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x_1`.`ParentID`, `x_1`.`CountResult`, - `x_1`.`SUM_1` + `x_1`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `od_1` WHERE `x`.`ParentID` = `od_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `x` ) `x_1` diff --git a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0.LinqService).sql index 8ac2127a0294..3fc5453d7bb9 100644 --- a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x`.`ParentID`, `x`.`CountResult`, - `x`.`SUM_1` + `x`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `a_Children_1` WHERE `o`.`ParentID` = `a_Children_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `o` ) `x` diff --git a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0.LinqService).sql index 57e1c5d9af25..1eaf955ccd2a 100644 --- a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0.LinqService).sql @@ -20,7 +20,7 @@ FROM `vpc`.`CategoryId`, `pop`.`ProductId`, COALESCE(`pcc`.`PeriodOrderLimit`,0) as `MaxCapacity`, - COALESCE(COALESCE(`vsp`.`SUM_1`,0),0) as `Quantity` + COALESCE(COALESCE(`vsp`.`Quantity`,0),0) as `Quantity` FROM `OrderPeriod` `op` INNER JOIN `ProductsPerOrderPeriod` `pop` ON `op`.`Id` = `pop`.`OrderPeriodId` @@ -30,7 +30,7 @@ FROM SELECT `agroup`.`Id`, `oi`.`ProductId`, - SUM(COALESCE(`oi`.`Quantity`,0)) as `SUM_1` + SUM(COALESCE(`oi`.`Quantity`,0)) as `Quantity` FROM `OrderPeriod` `agroup` LEFT JOIN `OrderHeader` `oh` ON `agroup`.`Id` = `oh`.`PeriodId` diff --git a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0.LinqService).sql index f5d8960629e9..eb2600d3b4e1 100644 --- a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0.LinqService).sql @@ -3,7 +3,7 @@ SELECT Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11))), - `t1`.`SUM_1`, + `t1`.`SubSum`, EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN `Parent` `a_Parent` ON `c_1`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = `f`.`ParentID` AND (`a_Parent`.`Value1` = `f`.`Value1` OR `a_Parent`.`Value1` IS NULL AND `f`.`Value1` IS NULL) - ) as `SUM_1`, + ) as `SubSum`, `f`.`ParentID` FROM `Parent` `f` ) `t1` WHERE LOCATE('1', Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11)))) > 0 AND - `t1`.`SUM_1` > 0 + `t1`.`SubSum` > 0 diff --git a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0.LinqService).sql index 94bfb3cb7e9a..51792d59bf61 100644 --- a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0.LinqService).sql @@ -5,13 +5,13 @@ SELECT `p1`.`ParentID`, `p1`.`Value1`, `p2`.`Key_1`, - `p2`.`SUM_1` + `p2`.`Sum_1` FROM `Parent` `p1` INNER JOIN ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0.LinqService).sql index 8292dae95037..8803e43cc457 100644 --- a/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0.LinqService).sql @@ -3,14 +3,14 @@ SELECT `t1`.`Key_1`, - `t1`.`SUM_1`, + `t1`.`Sum_1`, `p2`.`Key_1`, `p2`.`Sum_1` FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0.LinqService).sql index e78e1d6ab4f5..4c56122ff356 100644 --- a/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0.LinqService).sql b/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0.LinqService).sql index e78e1d6ab4f5..4c56122ff356 100644 --- a/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0.LinqService).sql +++ b/MySqlConnector.8.0.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0.LinqService).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/MySqlConnector.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..6c5e192f80a5 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(MySqlConnector.8.0).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + MIN(`t1`.`ParentID`) +FROM + `Parent` `t1` +WHERE + `t1`.`ParentID` < 0 + diff --git a/MySqlConnector.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..aba1bf73fbab --- /dev/null +++ b/MySqlConnector.8.0/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(MySqlConnector.8.0).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + ( + SELECT + MIN(`a_Children`.`ParentID`) + FROM + `Child` `a_Children` + WHERE + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ParentID` < 0 + ) +FROM + `Parent` `p` + diff --git a/MySqlConnector.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0).sql index 845bfef2f319..4db3711e4a97 100644 --- a/MySqlConnector.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(MySqlConnector.8.0).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ `p`.`ParentID`, `p`.`Value1`, - `t1`.`COUNT_1` + `t1`.`Count_1` FROM ( SELECT /*+ QB_NAME(Inline) */ `c_1`.`ParentID`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY diff --git a/MySqlConnector.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0).sql index 83970f5ae310..9d06773a26fb 100644 --- a/MySqlConnector.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(MySqlConnector.8.0).sql @@ -25,5 +25,5 @@ FROM GROUP BY `tt`.`Key_1` HAVING - SUM(`tt`.`ID`) <> 0 + SUM(`tt`.`ID`) <> 0 OR SUM(`tt`.`ID`) IS NULL diff --git a/MySqlConnector.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0,False).sql b/MySqlConnector.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0,False).sql index 7e608a17e518..0f02063646c5 100644 --- a/MySqlConnector.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0,False).sql +++ b/MySqlConnector.8.0/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(MySqlConnector.8.0,False).sql @@ -2,27 +2,23 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` IN (@In, @In_1) + `s`.`CEnum` IN (@In, @In) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM `Src` `s` WHERE - `s`.`CEnum` NOT IN (@NotIn, @NotIn_1) + `s`.`CEnum` NOT IN (@NotIn, @NotIn) diff --git a/MySqlConnector.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0).sql index a6995bccefc2..b40ffeb410a3 100644 --- a/MySqlConnector.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(MySqlConnector.8.0).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `p`.`ID` + CAST(CAST(`p`.`ID` AS UNSIGNED) AS CHAR(3)) FROM `LinqDataTypes` `p` WHERE diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0).sql index 3919afeb07ee..3129cd009a89 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(MySqlConnector.8.0).sql @@ -11,7 +11,7 @@ FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` - ) `g_2` + ) `t1` WHERE - `g_2`.`ParentID` > 2 + `t1`.`ParentID` > 2 diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0).sql index 40144709788c..9125e74c8ceb 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(MySqlConnector.8.0).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0).sql index 625ac67e4bcb..8f944a00fe5e 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(MySqlConnector.8.0).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - `Child` `p` - INNER JOIN `Parent` `a_Parent` ON `p`.`ParentID` = `a_Parent`.`ParentID` + `Child` `ch` + INNER JOIN `Parent` `a_Parent` ON `ch`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = 1 diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0).sql index 48c6ee4228ef..7975d0e3873c 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(MySqlConnector.8.0).sql @@ -2,22 +2,22 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0).sql index 48c6ee4228ef..7975d0e3873c 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(MySqlConnector.8.0).sql @@ -2,22 +2,22 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `g_2`.`MAX_1`, - `g_2`.`COUNT_1` + 1, - `g_2`.`COUNT_1`, - `g_2`.`COUNT_2` + `g_2`.`Max_1`, + `g_2`.`Count_1` + 1, + `g_2`.`Count_1`, + `g_2`.`Count_2` FROM ( SELECT - MAX(`g_1`.`ChildID`) as `MAX_1`, + MAX(`g_1`.`ChildID`) as `Max_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1`, + END) as `Count_1`, COUNT(CASE WHEN `g_1`.`ChildID` > 10 THEN 1 ELSE NULL - END) as `COUNT_2` + END) as `Count_2` FROM `Child` `g_1` GROUP BY diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0).sql index f19b39c50bb0..9c288eb28ecd 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(MySqlConnector.8.0).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN `g_1`.`ChildID` > 20 THEN 1 ELSE NULL - END) as `COUNT_1` + END) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 OR `g_2`.`Key_1` > 2 + `g_2`.`Count_1` > 2 OR `g_2`.`Key_1` > 2 diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0).sql index c6f994ac7f55..9188bb4a8278 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(MySqlConnector.8.0).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`Key_1` < 5 + `g_2`.`Count_1` > 2 AND `g_2`.`Key_1` < 5 diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0).sql index be6ad4e0b284..93a28a268db6 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(MySqlConnector.8.0).sql @@ -7,12 +7,12 @@ FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`COUNT_1` > 3 OR `g_2`.`Key_1` = 1 + `g_2`.`Count_1` > 3 OR `g_2`.`Key_1` = 1 diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0).sql index 7a71617ff101..8dbfdb051005 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(MySqlConnector.8.0).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t2`.`COUNT_1` + `t2`.`COUNT_1` + `t2`.`Count_1` + `t2`.`Count_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM `Child` `c_1` WHERE `t1`.`ParentID` = `c_1`.`ParentID` - ) as `COUNT_1` + ) as `Count_1` FROM `Parent` `t1` ) `t2` diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0).sql index 2ca745392a22..81e8a8b12405 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(MySqlConnector.8.0).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0).sql index 2ca745392a22..81e8a8b12405 100644 --- a/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(MySqlConnector.8.0).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children_1` WHERE - `p`.`ParentID` = `c_1`.`ParentID` + `p`.`ParentID` = `a_Children_1`.`ParentID` ) END FROM diff --git a/MySqlConnector.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0).sql index 32699936a530..51241ff13d2e 100644 --- a/MySqlConnector.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(MySqlConnector.8.0).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t2`.`SUM_1` + `t2`.`Sum_1` FROM `Parent` `p` LEFT JOIN LATERAL ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN `d`.`ParentID` IS NOT NULL THEN `d`.`ParentID` ELSE -100 - END) as `SUM_1` + END) as `Sum_1` FROM ( SELECT diff --git a/MySqlConnector.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..2a1fa6e540e7 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(MySqlConnector.8.0).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group_1`, + `t1`.`Date_1`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY `e`.`Id`, `e`.`Name` ORDER BY `e`.`Name`, `e`.`Date` DESC) as `RowNumber`, + `e`.`Name`, + `e`.`Date` as `Date_1`, + `e`.`Id`, + `e`.`Group` as `Group_1`, + `e`.`Amount`, + `e`.`IsActive` + FROM + `TestData` `e` + ) `t1` +WHERE + `t1`.`RowNumber` = 1 +ORDER BY + `t1`.`Name`, + `t1`.`Date_1` DESC + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`Name`, + `t1`.`Group`, + `t1`.`Date`, + `t1`.`Amount`, + `t1`.`IsActive` +FROM + `TestData` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0).sql index fff0de5ad80e..80da07e96efd 100644 --- a/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(MySqlConnector.8.0).sql @@ -2,13 +2,13 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t3`.`SUM_1`, - `t6`.`COUNT_1` + `t3`.`Sum_1`, + `t6`.`Count_1` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - SUM(`t2`.`DetailId`) as `SUM_1` + SUM(`t2`.`DetailId`) as `Sum_1` FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) `t3` ON 1=1 LEFT JOIN LATERAL ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM ( SELECT diff --git a/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0).sql index 29be5d07f27a..d2545000720e 100644 --- a/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(MySqlConnector.8.0).sql @@ -2,12 +2,12 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t3`.`AVG_1` + `t3`.`Average` FROM `MasterClass` `m_1` LEFT JOIN LATERAL ( SELECT - AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `AVG_1` + AVG(CAST(`t2`.`DetailId` AS DOUBLE)) as `Average` FROM ( SELECT diff --git a/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySqlConnector.8.0).sql index 818184a7f7e3..8e91becfcfbf 100644 --- a/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(MySqlConnector.8.0).sql @@ -2,7 +2,6 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `it_1`.`cond_1`, `it_1`.`cond`, `it_1`.`ColorName`, `it_1`.`StyleName`, @@ -17,7 +16,7 @@ FROM LEFT JOIN `SomeStyle` `a_Style` ON `t3`.`StyleId` = `a_Style`.`Id` LEFT JOIN ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `SomeItem` `t1` ) `t2` ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT `it`.`ColorName`, `it`.`Count` as `Count_1`, - `it`.`index` as `cond`, `it`.`StyleName`, `it`.`Conditional`, `it`.`field1`, `it`.`field2`, `it`.`field3`, - 1 as `cond_1` + 1 as `cond` FROM ( - SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`COUNT_1` AS `Count`, 0 AS `index`, `a_Style`.`Name` AS `StyleName`, CASE - WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`COUNT_1` + SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`Count_1` AS `Count`, `a_Style`.`Name` AS `StyleName`, CASE + WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`Count_1` ELSE 0 END AS `Conditional`, 1 AS `field1`, 2 AS `field2`, 3 AS `field3` UNION ALL - SELECT NULL, 0, 1, `a_Style`.`Name`, NULL, 4, 5, 6) `it` + SELECT NULL, 0, `a_Style`.`Name`, NULL, 4, 5, 6) `it` ) `it_1` ON 1=1 WHERE `it_1`.`ColorName` = 'Red' OR `it_1`.`Count_1` = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN `SomeColor` `a_Color` ON `t3`.`ColorId` = `a_Color`.`Id` LEFT JOIN ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `SomeItem` `t1` ) `t2` ON 1=1 LEFT JOIN LATERAL ( - SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`COUNT_1` AS `Count`, CASE - WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`COUNT_1` + SELECT `a_Color`.`Name` AS `ColorName`, `t2`.`Count_1` AS `Count`, CASE + WHEN `a_Color`.`Name` = 'Red' THEN `t2`.`Count_1` ELSE 0 END AS `Conditional` UNION ALL diff --git a/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySqlConnector.8.0).sql index 950e504eb6ec..25a0ecfe3f47 100644 --- a/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(MySqlConnector.8.0).sql @@ -20,7 +20,7 @@ FROM ( SELECT `a_Color`.`Name` AS `ColorName`, `a_Style`.`Name` AS `StyleName`, ( SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `SomeItem` `t1` ) AS `Count` diff --git a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0).sql index e057fd2bf51d..18b1cbcb084a 100644 --- a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(MySqlConnector.8.0).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 0 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 0 ) FROM `Parent` `p` diff --git a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0).sql index f5ac8edfd251..be989ef26b2e 100644 --- a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(MySqlConnector.8.0).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > 1 + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > 1 ) FROM `Parent` `p` diff --git a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0).sql index 8deaa5bcffa0..7c33aec90417 100644 --- a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(MySqlConnector.8.0).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 2 FROM `Parent` `p` diff --git a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0).sql index 8d1db43198cf..c7f6f4bf938c 100644 --- a/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(MySqlConnector.8.0).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - `Child` `c_1` + `Child` `a_Children` WHERE - `p`.`ParentID` = `c_1`.`ParentID` AND `c_1`.`ChildID` > @n + `p`.`ParentID` = `a_Children`.`ParentID` AND `a_Children`.`ChildID` > @n ) + 4 FROM `Parent` `p` diff --git a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0).sql index 52d9e4400ce5..9d979d294648 100644 --- a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(MySqlConnector.8.0).sql @@ -2,97 +2,41 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t7`.`Key_1`, - `t7`.`COUNT_1`, - `t7`.`COUNT_2`, - `t7`.`COUNT_3`, - `t7`.`COUNT_4`, - `t1`.`COUNT_1`, - `t3`.`COUNT_1`, - `t4`.`COUNT_1`, - `t7`.`COUNT_5`, - `t6`.`COUNT_1` + `t`.`GroupId`, + COUNT(*), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT `t`.`DataValue`), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(CASE + WHEN `t`.`DataValue` % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN `t`.`DataValue` % 2 = 0 THEN `t`.`DataValue` + ELSE NULL + END), + COUNT(DISTINCT `t`.`DataValue`) FROM - ( - SELECT - `t`.`GroupId` as `Key_1`, - COUNT(*) as `COUNT_1`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_2`, - COUNT(*) as `COUNT_3`, - COUNT(DISTINCT `t`.`DataValue`) as `COUNT_4`, - COUNT(CASE - WHEN `t`.`DataValue` % 2 = 0 THEN 1 - ELSE NULL - END) as `COUNT_5` - FROM - `AggregationData` `t` - WHERE - `t`.`DataValue` IS NOT NULL - GROUP BY - `t`.`GroupId` - ) `t7` - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x`.`DataValue` - FROM - `AggregationData` `x` - WHERE - `x`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x`.`GroupId` - ) `x_1` - WHERE - `x_1`.`DataValue` % 2 = 0 - ) `t1` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_1`.`DataValue` - FROM - `AggregationData` `t_1` - WHERE - `t_1`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_1`.`GroupId` AND - `t_1`.`DataValue` % 2 = 0 - ) `t2` - ) `t3` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `x_2`.`DataValue` - FROM - `AggregationData` `x_2` - WHERE - `x_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `x_2`.`GroupId` AND - `x_2`.`DataValue` % 2 = 0 - ) `x_3` - WHERE - `x_3`.`DataValue` % 2 = 0 - ) `t4` ON 1=1 - LEFT JOIN LATERAL ( - SELECT - COUNT(*) as `COUNT_1` - FROM - ( - SELECT DISTINCT - `t_2`.`DataValue` - FROM - `AggregationData` `t_2` - WHERE - `t_2`.`DataValue` IS NOT NULL AND `t7`.`Key_1` = `t_2`.`GroupId` AND - `t_2`.`DataValue` % 2 = 0 - ) `t5` - ) `t6` ON 1=1 + `AggregationData` `t` +WHERE + `t`.`DataValue` IS NOT NULL +GROUP BY + `t`.`GroupId` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 diff --git a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0).sql index 52676ec07522..c77e0be528d1 100644 --- a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(MySqlConnector.8.0).sql @@ -7,7 +7,7 @@ FROM ( SELECT `a_Parent`.`ParentID`, - COUNT(*) as `COUNT_1`, + COUNT(*) as `Count_1`, `a_Parent`.`Value1` FROM `GrandChild` `g_1` @@ -17,5 +17,5 @@ FROM `a_Parent`.`Value1` ) `g_2` WHERE - `g_2`.`COUNT_1` > 2 AND `g_2`.`ParentID` <> 1 + `g_2`.`Count_1` > 2 AND `g_2`.`ParentID` <> 1 diff --git a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0).sql index 05cd67f2a689..a50deeee7d2f 100644 --- a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(MySqlConnector.8.0).sql @@ -2,23 +2,23 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `g_2`.`MIN_2` + `g_2`.`Min_2` FROM ( SELECT MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1`, + END) as `Min_1`, MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_2` + END) as `Min_2` FROM `Child` `g_1` GROUP BY `g_1`.`ParentID` ) `g_2` WHERE - `g_2`.`MIN_1` IS NOT NULL + `g_2`.`Min_1` IS NOT NULL diff --git a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0).sql index f443cfd869a9..d0aac5d1508d 100644 --- a/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(MySqlConnector.8.0).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `g_2`.`MIN_1` + `g_2`.`Min_1` FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN `g_1`.`ParentID` > 2 THEN `g_1`.`ChildID` ELSE NULL - END) as `MIN_1` + END) as `Min_1` FROM `Child` `g_1` GROUP BY diff --git a/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,5).sql b/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,5).sql index 6ad741643198..07ecd7ceebc1 100644 --- a/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,5).sql +++ b/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,5).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 @@ -10,5 +10,5 @@ BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` diff --git a/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,6).sql b/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,6).sql index 0095530d880c..173918438d7e 100644 --- a/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,6).sql +++ b/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,6).sql @@ -2,13 +2,13 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,null).sql b/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,null).sql index 0095530d880c..173918438d7e 100644 --- a/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,null).sql +++ b/MySqlConnector.8.0/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.OptimizeConstants(MySqlConnector.8.0,null).sql @@ -2,13 +2,13 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` WHERE 1 = 0 diff --git a/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0).sql index b9570149af45..97fd98760c49 100644 --- a/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(MySqlConnector.8.0).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertKey`, `al_group_2`.`AlertCode`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0).sql index ee382a300028..dd97ed087fde 100644 --- a/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(MySqlConnector.8.0).sql @@ -51,14 +51,14 @@ FROM `trade_2`.`DealId` as `cond_1`, `trade_2`.`ParcelId`, `trade_2`.`CounterParty`, - Coalesce(`t1`.`MAX_1`, `t1`.`CreationDate`) as `LastUpdate` + `t1`.`LastUpdate` FROM ( SELECT `al_group_2`.`AlertCode`, `al_group_2`.`AlertKey`, `al_group_2`.`CreationDate`, - MAX(`au_1`.`TransactionDate`) as `MAX_1` + Coalesce(MAX(`au_1`.`TransactionDate`), `al_group_2`.`CreationDate`) as `LastUpdate` FROM `Alert` `al_group_2` LEFT JOIN `AuditAlert` `au_1` ON `au_1`.`AlertKey` = `al_group_2`.`AlertKey` diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0).sql index 4305af7001b7..ad9e3e3b367e 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(MySqlConnector.8.0).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0).sql index dd66007232c5..140a620a3b99 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(MySqlConnector.8.0).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0).sql index 4567db21f7f1..299a89842d5f 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(MySqlConnector.8.0).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,1).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,1).sql index e8d5c7f7ea90..bbfed5a2b935 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,1).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,2).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,2).sql index e8d5c7f7ea90..bbfed5a2b935 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,2).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT - ROUND(`p`.`MoneyValue`, 1) as `c1`, - `p`.`MoneyValue` + ROUND(`p`.`MoneyValue`, 1) as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,1).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,1).sql index dd66007232c5..140a620a3b99 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,1).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,1).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,2).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,2).sql index dd66007232c5..140a620a3b99 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,2).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(MySqlConnector.8.0,ToEven,2).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0).sql index 4305af7001b7..ad9e3e3b367e 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(MySqlConnector.8.0).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0).sql index dd66007232c5..140a620a3b99 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(MySqlConnector.8.0).sql @@ -2,7 +2,7 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 ELSE ROUND(`p`.`MoneyValue`, 1) - END as `c1`, - `p`.`MoneyValue` + END as `c1` FROM `LinqDataTypes` `p` ) `t` diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0).sql index 4567db21f7f1..299a89842d5f 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(MySqlConnector.8.0).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` * 2 = ROUND(`p`.`MoneyValue` * 2, 1) AND `p`.`MoneyValue` <> ROUND(`p`.`MoneyValue`, 1) + THEN ROUND(`p`.`MoneyValue` / 2, 1) * 2 + ELSE ROUND(`p`.`MoneyValue`, 1) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` * 2 = ROUND(`t`.`MoneyValue` * 2, 1) AND `t`.`MoneyValue` <> ROUND(`t`.`MoneyValue`, 1) - THEN ROUND(`t`.`MoneyValue` / 2, 1) * 2 - ELSE ROUND(`t`.`MoneyValue`, 1) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0).sql index f8f8bfd7f8a1..2cadc954b93e 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(MySqlConnector.8.0).sql @@ -2,9 +2,14 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0).sql index f8f8bfd7f8a1..2cadc954b93e 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(MySqlConnector.8.0).sql @@ -2,9 +2,14 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`) <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0).sql index 4305af7001b7..ad9e3e3b367e 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(MySqlConnector.8.0).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0).sql index 4305af7001b7..ad9e3e3b367e 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(MySqlConnector.8.0).sql @@ -2,13 +2,18 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + CASE + WHEN `p`.`MoneyValue` - FLOOR(`p`.`MoneyValue`) = 0.5 AND (FLOOR(`p`.`MoneyValue`) % 2) = 0 + THEN FLOOR(`p`.`MoneyValue`) + ELSE ROUND(`p`.`MoneyValue`, 0) + END as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - CASE - WHEN `t`.`MoneyValue` - FLOOR(`t`.`MoneyValue`) = 0.5 AND (FLOOR(`t`.`MoneyValue`) % 2) = 0 - THEN FLOOR(`t`.`MoneyValue`) - ELSE ROUND(`t`.`MoneyValue`, 0) - END <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0).sql index d3f20c7ea09a..f300481069bc 100644 --- a/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(MySqlConnector.8.0).sql @@ -2,9 +2,14 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `t`.`MoneyValue` + `t`.`c1` FROM - `LinqDataTypes` `t` + ( + SELECT + ROUND(`p`.`MoneyValue`, 1) as `c1` + FROM + `LinqDataTypes` `p` + ) `t` WHERE - ROUND(`t`.`MoneyValue`, 1) <> 0 + `t`.`c1` <> 0 diff --git a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0).sql index 074488a6529e..4c4c4d0e43f4 100644 --- a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(MySqlConnector.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0).sql index 074488a6529e..4c4c4d0e43f4 100644 --- a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(MySqlConnector.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 2 + `s`.`Int` = 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 2 + `s`.`Int` <> 2 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` = 4 + `s`.`Int` = 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`Int` <> 4 + `s`.`Int` <> 4 BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 2 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 2 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL + `s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableInt` = 4 OR `x`.`NullableInt` IS NULL) + NOT (`s`.`NullableInt` = 4 OR `s`.`NullableInt` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NULL + `s`.`NullableInt` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableInt` IS NOT NULL + `s`.`NullableInt` IS NOT NULL diff --git a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0).sql index 19e8c87a6c4d..d4717c3b015e 100644 --- a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(MySqlConnector.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0).sql index 19e8c87a6c4d..d4717c3b015e 100644 --- a/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(MySqlConnector.8.0).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'abc' OR `x`.`String` IS NULL + `s`.`String` = 'abc' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'abc' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'abc' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` = 'xyz' OR `x`.`String` IS NULL + `s`.`String` = 'xyz' OR `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`String` = 'xyz' OR `x`.`String` IS NULL) + NOT (`s`.`String` = 'xyz' OR `s`.`String` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NULL + `s`.`String` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`String` IS NOT NULL + `s`.`String` IS NOT NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'abc' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'abc' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL + `s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - NOT (`x`.`NullableString` = 'xyz' OR `x`.`NullableString` IS NULL) + NOT (`s`.`NullableString` = 'xyz' OR `s`.`NullableString` IS NULL) BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NULL + `s`.`NullableString` IS NULL BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - `Src` `x` + `Src` `s` WHERE - `x`.`NullableString` IS NOT NULL + `s`.`NullableString` IS NOT NULL diff --git a/MySqlConnector.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0).sql index 448a4ad2a03c..b3e93b8643c8 100644 --- a/MySqlConnector.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(MySqlConnector.8.0).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), `x`.`Key_1`, `x`.`Count_1`, - `x`.`MAX_1` + `x`.`Max_1` FROM ( SELECT `summary`.`LastName` as `Key_1`, COUNT(*) as `Count_1`, - MAX(`summary`.`FirstName`) as `MAX_1` + MAX(`summary`.`FirstName`) as `Max_1` FROM `Person` `summary` GROUP BY diff --git a/MySqlConnector.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySqlConnector.8.0).sql index bf01ce87a6d9..5777d04fa7eb 100644 --- a/MySqlConnector.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(MySqlConnector.8.0).sql @@ -5,6 +5,8 @@ SELECT CONCAT_WS(' -> ', `t`.`Value2`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -13,6 +15,8 @@ SELECT CONCAT_WS(' -> ', `t`.`Value3`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value1`, `t`.`Value2`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` BeforeExecute -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', `t`.`Value3`, `t`.`Value3`) FROM `SampleClass` `t` +ORDER BY + `t`.`Id` diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..620460194669 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(MySqlConnector.8.0).sql @@ -0,0 +1,52 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + CONCAT_WS(', ', Coalesce(`t`.`NullableValue`, ''), `t`.`NotNullableValue`, Coalesce(`t`.`VarcharValue`, ''), Coalesce(`t`.`NVarcharValue`, '')), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT CASE + WHEN `t2`.`item` <> 'A' OR `t2`.`item` IS NULL THEN Coalesce(`t2`.`item`, '') + ELSE NULL + END ORDER BY CASE + WHEN `t2`.`item` IS NULL THEN 0 + ELSE 1 + END, `t2`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NotNullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t2` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..5549e06dfcbc --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(MySqlConnector.8.0).sql @@ -0,0 +1,33 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + CONCAT_WS(', ', `t`.`NullableValue`, `t`.`NotNullableValue`, `t`.`VarcharValue`, `t`.`NVarcharValue`), + ( + SELECT + Coalesce(GROUP_CONCAT(DISTINCT `t1`.`item` ORDER BY `t1`.`item` SEPARATOR ', '), '') + FROM + ( + SELECT `t`.`NullableValue` AS `item` + UNION ALL + SELECT `t`.`NotNullableValue` + UNION ALL + SELECT `t`.`VarcharValue` + UNION ALL + SELECT `t`.`NVarcharValue`) `t1` + ) +FROM + `SampleClass` `t` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..275efe388f79 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(MySqlConnector.8.0).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`c1` +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN LOCATE('A', `t`.`NullableValue`) > 0 THEN `t`.`NullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NotNullableValue`) > 0 THEN `t`.`NotNullableValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`VarcharValue`) > 0 THEN `t`.`VarcharValue` + ELSE NULL + END, CASE + WHEN LOCATE('A', `t`.`NVarcharValue`) > 0 THEN `t`.`NVarcharValue` + ELSE NULL + END) as `c1` + FROM + `SampleClass` `t` + ) `x` +WHERE + `x`.`c1` RLIKE '[^ + …             

  ]' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..b61715e76bf0 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(MySqlConnector.8.0).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..7aae7eec4e24 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(MySqlConnector.8.0).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..862ddda58725 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(MySqlConnector.8.0).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + Coalesce(GROUP_CONCAT(`t1`.`NullableValue` ORDER BY `t1`.`NotNullableValue` SEPARATOR ', '), '') +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..65ac931963ab --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(MySqlConnector.8.0).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..20f75d7c8b60 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(MySqlConnector.8.0).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t5`.`Key_1`, + `t2`.`Join_1`, + `t4`.`Join_1` +FROM + ( + SELECT + `g_1`.`Id` as `Key_1` + FROM + `SampleClass` `g_1` + GROUP BY + `g_1`.`Id` + ) `t5` + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce(`t1`.`NullableValue`, '') SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x`.`NullableValue` + FROM + `SampleClass` `x` + WHERE + `t5`.`Key_1` = `x`.`Id` + ORDER BY + `x`.`NotNullableValue` + LIMIT 2 + ) `t1` + ) `t2` ON 1=1 + LEFT JOIN LATERAL ( + SELECT + Coalesce(GROUP_CONCAT(`t3`.`NotNullableValue` SEPARATOR ', '), '') as `Join_1` + FROM + ( + SELECT + `x_1`.`NotNullableValue` + FROM + `SampleClass` `x_1` + WHERE + `t5`.`Key_1` = `x_1`.`Id` + ORDER BY + `x_1`.`NotNullableValue` + LIMIT 2 + ) `t3` + ) `t4` ON 1=1 +ORDER BY + `t5`.`Key_1` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..a861fbbbf4c1 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(MySqlConnector.8.0).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') ORDER BY Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..d66aa189eeb1 --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(MySqlConnector.8.0).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `g_1`.`Id`, + Coalesce(GROUP_CONCAT(`g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue`, `g_1`.`Id` SEPARATOR ', '), ''), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..38a613e8513e --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(MySqlConnector.8.0).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), + Coalesce(GROUP_CONCAT(CASE + WHEN `g_1`.`NullableValue` <> '' THEN `g_1`.`NullableValue` + ELSE NULL + END ORDER BY `g_1`.`NotNullableValue`, `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(Coalesce(`g_1`.`NullableValue`, '') ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', '), + GROUP_CONCAT(`g_1`.`NotNullableValue` ORDER BY CASE + WHEN `g_1`.`NullableValue` IS NULL THEN 0 + ELSE 1 + END, `g_1`.`NotNullableValue` DESC, `g_1`.`NullableValue` SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..384bc84837ed --- /dev/null +++ b/MySqlConnector.8.0/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(MySqlConnector.8.0).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `g_1`.`Id`, + GROUP_CONCAT(DISTINCT Coalesce(`g_1`.`NullableValue`, '') SEPARATOR ', '), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` SEPARATOR ', '), ''), + Coalesce(GROUP_CONCAT(DISTINCT `g_1`.`NullableValue` ORDER BY `g_1`.`NullableValue` DESC SEPARATOR ', '), ''), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` SEPARATOR ', '), + GROUP_CONCAT(DISTINCT `g_1`.`NotNullableValue` ORDER BY `g_1`.`NotNullableValue` DESC SEPARATOR ', ') +FROM + `SampleClass` `g_1` +GROUP BY + `g_1`.`Id` +ORDER BY + `g_1`.`Id` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`Id`, + `t1`.`NullableValue`, + `t1`.`NotNullableValue`, + `t1`.`VarcharValue`, + `t1`.`NVarcharValue` +FROM + `SampleClass` `t1` + diff --git a/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0).sql index 8bfc694ddaa6..8ec924bb0c36 100644 --- a/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(MySqlConnector.8.0).sql @@ -9,30 +9,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute DisposeTransaction diff --git a/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0).sql index 521cf3eef841..9d5a3ec197e0 100644 --- a/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(MySqlConnector.8.0).sql @@ -9,30 +9,25 @@ SELECT `d`.`Amount`, `d`.`Currency` FROM - ( - SELECT DISTINCT - `x`.`Id` + `TransactionEntity` `m_1` + INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` +WHERE + EXISTS( + SELECT + `a_Lines`.`Currency` FROM - `TransactionEntity` `x` + `LineEntity` `a_Lines` WHERE - EXISTS( - SELECT - `a_Lines`.`Currency` - FROM - `LineEntity` `a_Lines` - WHERE - `x`.`Id` = `a_Lines`.`TransactionId` - INTERSECT - SELECT - `t1`.`item` - FROM - ( - SELECT 'A' AS `item` - UNION ALL - SELECT 'B') `t1` - ) - ) `m_1` - INNER JOIN `LineEntity` `d` ON `m_1`.`Id` = `d`.`TransactionId` + `m_1`.`Id` = `a_Lines`.`TransactionId` + INTERSECT + SELECT + `t1`.`item` + FROM + ( + SELECT 'A' AS `item` + UNION ALL + SELECT 'B') `t1` + ) BeforeExecute DisposeTransaction diff --git a/MySqlConnector.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0).sql index 6044d387a25b..44ec78710263 100644 --- a/MySqlConnector.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(MySqlConnector.8.0).sql @@ -2,12 +2,12 @@ -- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 SELECT - `g_1`.`COUNT_1` + `g_1`.`Count_1` FROM ( SELECT `c_1`.`ParentID` as `Key_1`, - COUNT(*) as `COUNT_1` + COUNT(*) as `Count_1` FROM `Child` `c_1` GROUP BY @@ -16,5 +16,5 @@ FROM `c_1`.`ParentID` > 1 ) `g_1` WHERE - `g_1`.`Key_1` > 1 AND `g_1`.`COUNT_1` > 1 + `g_1`.`Key_1` > 1 AND `g_1`.`Count_1` > 1 diff --git a/MySqlConnector.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/MySqlConnector.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 2e8cef49e84c..fe476bd16e6c 100644 --- a/MySqlConnector.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/MySqlConnector.8.0/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(MySqlConnector.8.0,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT `d`.`ValB`, `d`.`ValInt` FROM - ( - SELECT DISTINCT - `l1`.`ID`, - `l1`.`ValS` + `Issue3757Level1` `m_1` + INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` +WHERE + EXISTS( + SELECT + * FROM - `Issue3757Level1` `l1` + `Issue3757Level2` `c_1` WHERE - EXISTS( - SELECT - * - FROM - `Issue3757Level2` `c_1` - WHERE - `l1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `l1`.`ValS`) > 0 AND - `l1`.`ValS` IS NOT NULL - ) - ) `m_1` - INNER JOIN `Issue3757Level2` `d` ON `m_1`.`ID` = `d`.`ParentId` + `m_1`.`ID` = `c_1`.`ParentId` AND LOCATE(@TypedProperty, `m_1`.`ValS`) > 0 AND + `m_1`.`ValS` IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0).sql index 9163ce605230..479fa8e65c29 100644 --- a/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(MySqlConnector.8.0).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x_1`.`ParentID`, `x_1`.`CountResult`, - `x_1`.`SUM_1` + `x_1`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `od_1` WHERE `x`.`ParentID` = `od_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `x` ) `x_1` diff --git a/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0).sql index 35e45c491468..a7f37e703234 100644 --- a/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(MySqlConnector.8.0).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT `x`.`ParentID`, `x`.`CountResult`, - `x`.`SUM_1` + `x`.`Sum_1` FROM ( SELECT @@ -56,7 +56,7 @@ FROM `Child` `a_Children_1` WHERE `o`.`ParentID` = `a_Children_1`.`ParentID` - ) as `SUM_1` + ) as `Sum_1` FROM `Parent` `o` ) `x` diff --git a/MySqlConnector.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySqlConnector.8.0).sql index eb0a3cf47959..0320d2a0e353 100644 --- a/MySqlConnector.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(MySqlConnector.8.0).sql @@ -9,17 +9,12 @@ SELECT `d`.`ChildID` FROM ( - SELECT DISTINCT - `t2`.`ParentID` + SELECT + `a_Parent`.`ParentID` FROM - ( - SELECT - `a_Parent`.`ParentID` - FROM - `Child` `t1` - LEFT JOIN `Parent` `a_Parent` ON `t1`.`ParentID` = `a_Parent`.`ParentID` - LIMIT 1 - ) `t2` + `Child` `t1` + LEFT JOIN `Parent` `a_Parent` ON `t1`.`ParentID` = `a_Parent`.`ParentID` + LIMIT 1 ) `m_1` INNER JOIN `Child` `d` ON `m_1`.`ParentID` = `d`.`ParentID` diff --git a/MySqlConnector.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0).sql index f560f4499a24..1226f3f577f0 100644 --- a/MySqlConnector.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(MySqlConnector.8.0).sql @@ -20,7 +20,7 @@ FROM `vpc`.`CategoryId`, `pop`.`ProductId`, COALESCE(`pcc`.`PeriodOrderLimit`,0) as `MaxCapacity`, - COALESCE(COALESCE(`vsp`.`SUM_1`,0),0) as `Quantity` + COALESCE(COALESCE(`vsp`.`Quantity`,0),0) as `Quantity` FROM `OrderPeriod` `op` INNER JOIN `ProductsPerOrderPeriod` `pop` ON `op`.`Id` = `pop`.`OrderPeriodId` @@ -30,7 +30,7 @@ FROM SELECT `agroup`.`Id`, `oi`.`ProductId`, - SUM(COALESCE(`oi`.`Quantity`,0)) as `SUM_1` + SUM(COALESCE(`oi`.`Quantity`,0)) as `Quantity` FROM `OrderPeriod` `agroup` LEFT JOIN `OrderHeader` `oh` ON `agroup`.`Id` = `oh`.`PeriodId` diff --git a/MySqlConnector.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0).sql index 843ce819400e..41fa3e4463c3 100644 --- a/MySqlConnector.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(MySqlConnector.8.0).sql @@ -3,7 +3,7 @@ SELECT Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11))), - `t1`.`SUM_1`, + `t1`.`SubSum`, EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN `Parent` `a_Parent` ON `c_1`.`ParentID` = `a_Parent`.`ParentID` WHERE `a_Parent`.`ParentID` = `f`.`ParentID` AND (`a_Parent`.`Value1` = `f`.`Value1` OR `a_Parent`.`Value1` IS NULL AND `f`.`Value1` IS NULL) - ) as `SUM_1`, + ) as `SubSum`, `f`.`ParentID` FROM `Parent` `f` ) `t1` WHERE LOCATE('1', Concat(' ', CAST(Coalesce(`t1`.`Value1`, 0) AS CHAR(11)))) > 0 AND - `t1`.`SUM_1` > 0 + `t1`.`SubSum` > 0 diff --git a/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0).sql index 1da85e1b747a..b79e2b217175 100644 --- a/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(MySqlConnector.8.0).sql @@ -5,13 +5,13 @@ SELECT `p1`.`ParentID`, `p1`.`Value1`, `p2`.`Key_1`, - `p2`.`SUM_1` + `p2`.`Sum_1` FROM `Parent` `p1` INNER JOIN ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0).sql index c20d89c73b5e..4e2ac5eee155 100644 --- a/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(MySqlConnector.8.0).sql @@ -3,14 +3,14 @@ SELECT `t1`.`Key_1`, - `t1`.`SUM_1`, + `t1`.`Sum_1`, `p2`.`Key_1`, `p2`.`Sum_1` FROM ( SELECT `g_1`.`ParentID` as `Key_1`, - SUM(`g_1`.`ParentID`) as `SUM_1` + SUM(`g_1`.`ParentID`) as `Sum_1` FROM `Parent` `g_1` WHERE diff --git a/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0).sql index 70c2e2a1200d..e1e65ab725c6 100644 --- a/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(MySqlConnector.8.0).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0).sql index 70c2e2a1200d..e1e65ab725c6 100644 --- a/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0).sql +++ b/MySqlConnector.8.0/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(MySqlConnector.8.0).sql @@ -9,9 +9,9 @@ SET WHERE `b`.`ChildID` = ( SELECT - MAX(`b2`.`ParentID`) + MAX(`t1`.`ParentID`) FROM - `Child` `b2` + `Child` `t1` ) AND `b`.`ChildID` = -1 diff --git a/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite.MS).sql b/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite.MS).sql index 20bcd14a53c5..0623d6e1b76d 100644 --- a/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite.MS).sql +++ b/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite.MS).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80 + THEN 1 + ELSE 0 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80 - THEN 1 - ELSE 0 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite.MS).sql b/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite.MS).sql index 8c84c34d0af5..697f561dd0af 100644 --- a/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite.MS).sql +++ b/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite.MS).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25 + THEN 1 + ELSE 0 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25 - THEN 1 - ELSE 0 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite.MS).sql b/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite.MS).sql index 9431c640690d..4eb78436f849 100644 --- a/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite.MS).sql +++ b/Northwind.SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite.MS).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25 + THEN 0 + ELSE 1 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25 - THEN 0 - ELSE 1 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite.MS).sql b/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite.MS).sql index 314075f1994f..dfc0d1a70a19 100644 --- a/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite.MS).sql +++ b/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite.MS).sql @@ -3,16 +3,16 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_1] + [g_2].[Count_1] FROM ( SELECT [a_Employee].[EmployeeID], - [a_Employee].[LastName], COUNT(CASE WHEN [a_Employee].[FirstName] LIKE '%an%' ESCAPE '~' THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] diff --git a/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite.MS).sql b/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite.MS).sql index dff291953c0c..364d1b40d500 100644 --- a/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite.MS).sql +++ b/Northwind.SQLite.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite.MS).sql @@ -3,17 +3,17 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_2] + [g_2].[Count_2] FROM ( SELECT [a_Employee].[EmployeeID], - COUNT(*) as [COUNT_1], - [a_Employee].[LastName], + COUNT(*) as [Count_1], COUNT(CASE WHEN [a_Employee].[FirstName] LIKE '%an%' ESCAPE '~' THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] @@ -30,5 +30,5 @@ WHERE WHERE [g_2].[EmployeeID] = [a_EmployeeTerritories].[EmployeeID] ) > 1 AND - [g_2].[COUNT_1] > 2 + [g_2].[Count_1] > 2 diff --git a/Northwind.SQLite.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite.MS).sql b/Northwind.SQLite.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite.MS).sql index 20bcd14a53c5..0623d6e1b76d 100644 --- a/Northwind.SQLite.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite.MS).sql +++ b/Northwind.SQLite.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite.MS).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80 + THEN 1 + ELSE 0 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80 - THEN 1 - ELSE 0 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite).sql b/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite).sql index 96ceedad9219..2fdc7f82d328 100644 --- a/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite).sql +++ b/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(Northwind.SQLite).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80 + THEN 1 + ELSE 0 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80 - THEN 1 - ELSE 0 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite).sql b/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite).sql index 1f1f843b18db..9b1844a032cf 100644 --- a/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite).sql +++ b/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(Northwind.SQLite).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25 + THEN 1 + ELSE 0 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25 - THEN 1 - ELSE 0 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite).sql b/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite).sql index d41a4a866e5d..320aeec85357 100644 --- a/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite).sql +++ b/Northwind.SQLite/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(Northwind.SQLite).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25 + THEN 0 + ELSE 1 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25 - THEN 0 - ELSE 1 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite).sql b/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite).sql index af32d9eb4b51..2d0a73aff2ac 100644 --- a/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite).sql +++ b/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(Northwind.SQLite).sql @@ -3,16 +3,16 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_1] + [g_2].[Count_1] FROM ( SELECT [a_Employee].[EmployeeID], - [a_Employee].[LastName], COUNT(CASE WHEN [a_Employee].[FirstName] LIKE '%an%' ESCAPE '~' THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] diff --git a/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite).sql b/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite).sql index 5614ed0e3e43..68fb4fc246f8 100644 --- a/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite).sql +++ b/Northwind.SQLite/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(Northwind.SQLite).sql @@ -3,17 +3,17 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_2] + [g_2].[Count_2] FROM ( SELECT [a_Employee].[EmployeeID], - COUNT(*) as [COUNT_1], - [a_Employee].[LastName], + COUNT(*) as [Count_1], COUNT(CASE WHEN [a_Employee].[FirstName] LIKE '%an%' ESCAPE '~' THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] @@ -30,5 +30,5 @@ WHERE WHERE [g_2].[EmployeeID] = [a_EmployeeTerritories].[EmployeeID] ) > 1 AND - [g_2].[COUNT_1] > 2 + [g_2].[Count_1] > 2 diff --git a/Northwind.SQLite/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite).sql b/Northwind.SQLite/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite).sql index 96ceedad9219..2fdc7f82d328 100644 --- a/Northwind.SQLite/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite).sql +++ b/Northwind.SQLite/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(Northwind.SQLite).sql @@ -19,32 +19,25 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] + CASE + WHEN ( + SELECT + AVG([a_Orders].[Freight]) + FROM + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80 + THEN 1 + ELSE 0 + END as [Key_1] FROM - ( - SELECT - CASE - WHEN ( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80 - THEN 1 - ELSE 0 - END as [Key_1] - FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON ([m_1].[Key_1]) = (CASE WHEN ( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/Oracle.18.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..acd15c6ee385 --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/Oracle.18.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..7ae4cbd26256 --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + ( + SELECT + MIN(a_Children."ParentID") + FROM + "Child" a_Children + WHERE + p."ParentID" = a_Children."ParentID" AND a_Children."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/Oracle.18.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed.LinqService).sql index 094b2479a6b3..c264f236841e 100644 --- a/Oracle.18.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed.LinqService).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ p."ParentID", p."Value1", - t1.COUNT_1 + t1."Count_1" FROM ( SELECT /*+ QB_NAME(Inline) */ c_1."ParentID", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed.LinqService).sql index f6620532afad..2f5ef239c583 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt.ID) <> 0 + SUM(tt.ID) <> 0 OR SUM(tt.ID) IS NULL diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed.LinqService,False).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed.LinqService,False).sql index 0e2bcb5968c3..f23d9b3b5bee 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed.LinqService,False).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed.LinqService,False).sql @@ -2,27 +2,23 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) DECLARE @In_1 Varchar2 -- String SET @In_1 = NULL -DECLARE @In_2 Varchar2 -- String -SET @In_2 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In_1, :In_2) + s."CEnum" IN (:In_1, :In_1) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) DECLARE @NotIn Varchar2 -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar2 -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed.LinqService).sql index d6ee89dbea1c..afb7dcb31629 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed.LinqService).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed.LinqService).sql index d6ee89dbea1c..afb7dcb31629 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed.LinqService).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed.LinqService).sql index 81c4d48818b3..262f50c8aca6 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - p.ID + CAST(CAST(p.ID AS Number(3)) AS VarChar(255)) FROM "LinqDataTypes" p WHERE diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed.LinqService).sql index c21d07ec6733..03265ffafbe2 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed.LinqService).sql index 7e5de57281bd..ef91e475beeb 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed.LinqService).sql index 811eccd75451..b59cdd2892ac 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed.LinqService).sql index 381677205911..bd0048a9d846 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed.LinqService).sql @@ -2,22 +2,22 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed.LinqService).sql index 381677205911..bd0048a9d846 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed.LinqService).sql @@ -2,22 +2,22 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed.LinqService).sql index d591c3718e08..bdc157ac1218 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed.LinqService).sql index 3ef52b7f1b5a..46b51973b854 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed.LinqService).sql index 545cca3c233b..ac9d20cb0f54 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed.LinqService).sql index e8c482d70603..25ba6273408e 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t2.COUNT_1 + t2.COUNT_1 + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as COUNT_1 + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed.LinqService).sql index b22d0fcb4a3e..8a2ce18646ef 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed.LinqService).sql index b22d0fcb4a3e..8a2ce18646ef 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed.LinqService).sql index 522996244e37..89756cb316c0 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed.LinqService).sql @@ -5,7 +5,7 @@ SET @take = 5 SELECT g_2."Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed.LinqService).sql index 5bd3776fc8ce..ea8ce8c8622d 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t2.SUM_1 + t2."Sum_1" FROM "Parent" p OUTER APPLY ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN d."ParentID" IS NOT NULL THEN d."ParentID" ELSE -100 - END) as SUM_1 + END) as "Sum_1" FROM ( SELECT diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..9e5cb98e6337 --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed.LinqService).sql index d2d8ccdde282..f774b13c333f 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed.LinqService).sql @@ -2,13 +2,13 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t3.SUM_1, - t6.COUNT_1 + t3."Sum_1", + t6."Count_1" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - SUM(t2."DetailId") as SUM_1 + SUM(t2."DetailId") as "Sum_1" FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) t3 OUTER APPLY ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed.LinqService).sql index a00d97a8d8f4..8b9ffb093630 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed.LinqService).sql @@ -2,12 +2,12 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t3.AVG_1 + t3."Average" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - AVG(CAST(t2."DetailId" AS Float)) as AVG_1 + AVG(CAST(t2."DetailId" AS Float)) as "Average" FROM ( SELECT diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed.LinqService).sql index dcfbbd4230da..4c9ac2891321 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 0 ) FROM "Parent" p diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed.LinqService).sql index baeaa3a099bd..a883d5f76ac9 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 1 ) FROM "Parent" p diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed.LinqService).sql index e53996073dae..360de18419ec 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed.LinqService).sql index f7b35b06e0f5..9e36eb41d802 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed.LinqService).sql index 24cae92d16e3..88285b6ed296 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed.LinqService).sql @@ -2,97 +2,41 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t7."Key_1", - t7.COUNT_1, - t7.COUNT_2, - t7.COUNT_3, - t7.COUNT_4, - t1.COUNT_1, - t3.COUNT_1, - t4.COUNT_1, - t7.COUNT_5, - t6.COUNT_1 + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as COUNT_1, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_2, - COUNT(*) as COUNT_3, - COUNT(DISTINCT t."DataValue") as COUNT_4, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_5 - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t7 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t7."Key_1" = x."GroupId" - ) x_1 - WHERE - MOD(x_1."DataValue", 2) = 0D - ) t1 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t7."Key_1" = t_1."GroupId" AND - MOD(t_1."DataValue", 2) = 0D - ) t2 - ) t3 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t7."Key_1" = x_2."GroupId" AND - MOD(x_2."DataValue", 2) = 0D - ) x_3 - WHERE - MOD(x_3."DataValue", 2) = 0D - ) t4 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t7."Key_1" = t_2."GroupId" AND - MOD(t_2."DataValue", 2) = 0D - ) t5 - ) t6 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed.LinqService).sql index 395fdb778af9..cd294df5597a 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent."ParentID", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", a_Parent."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM a_Parent."Value1" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed.LinqService).sql index 154d448f06f5..58147a727159 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed.LinqService).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN t."Status" = 3 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Issue1192Table" t WHERE diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed.LinqService).sql index e098bf6cd3ad..05e3c5cd0f7b 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed.LinqService).sql @@ -2,23 +2,23 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MIN_2 + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1, + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_2 + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed.LinqService).sql index 1630c1cc80a4..5fc2b430acbb 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MIN_1 + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1 + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed.LinqService).sql index 25f124f61461..8d598de85438 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed.LinqService).sql index 1245d452f446..6c3b31b01810 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed.LinqService).sql index 6cbda0e76057..21073eb4d00c 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed.LinqService).sql index a10d212e2b20..69157d8c1611 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed.LinqService).sql index 6803e6d5949b..0b2ecfa99c4a 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,1).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,1).sql index 3e6d474a8437..3bb1877acf21 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,1).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,2).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,2).sql index 3e6d474a8437..3bb1877acf21 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,2).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,1).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,1).sql index a10d212e2b20..69157d8c1611 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,1).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,2).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,2).sql index a10d212e2b20..69157d8c1611 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,2).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed.LinqService).sql index b0e404edade2..d28a96252c34 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed.LinqService).sql index a10d212e2b20..69157d8c1611 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed.LinqService).sql index 6803e6d5949b..0b2ecfa99c4a 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed.LinqService).sql index 60551fae11b2..810eb4ccb6d9 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed.LinqService).sql @@ -2,9 +2,14 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue") as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed.LinqService).sql index ddb9100c2021..35bc1a6d8f1c 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed.LinqService).sql @@ -2,9 +2,14 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(CAST(p."MoneyValue" AS Float)) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(CAST(t."MoneyValue" AS Float)) <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed.LinqService).sql index 6cbda0e76057..21073eb4d00c 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed.LinqService).sql index b0e404edade2..d28a96252c34 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed.LinqService).sql index 893dd5b4ec3c..7a8ab3088bed 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed.LinqService).sql @@ -2,9 +2,14 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue", 1) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed.LinqService).sql index 422b7702da53..a0c318726ae1 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed.LinqService).sql index 422b7702da53..a0c318726ae1 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed.LinqService).sql index 04d92c19d971..bdaab77e7bf9 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed.LinqService).sql index 04d92c19d971..bdaab77e7bf9 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed.LinqService).sql index 2ca5b355535b..b603e79952c6 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed.LinqService).sql @@ -4,9 +4,9 @@ DECLARE @take Int32 SET @take = 1 SELECT - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", 1 + MIN(g_1."ChildID") as "c1", - MAX(g_1."ChildID") as MAX_1 + MAX(g_1."ChildID") as "Max_1" FROM "Child" g_1 FETCH NEXT :take ROWS ONLY diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed.LinqService).sql index ea8656eb0e32..3e0b4fd3231e 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed.LinqService).sql index ed7a1e020bfc..2f9b3116dfe1 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID" as "id", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed.LinqService).sql index ea8656eb0e32..3e0b4fd3231e 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed.LinqService).sql index cd1e606d5c92..1ec6285b1e6d 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x.MAX_1 + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as MAX_1 + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..f74fbb65dd4e --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,53 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + ( + SELECT + Coalesce(LISTAGG(t4."item", ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t4 + ), + t3."Join_1" +FROM + "SampleClass" t + OUTER APPLY ( + SELECT + LISTAGG(Coalesce(t2."item_1", ''), ', ') WITHIN GROUP (ORDER BY t2."item_1") as "Join_1" + FROM + ( + SELECT DISTINCT + t1."item" as "item_1" + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + WHERE + t1."item" IS NOT NULL + ) t2 + ) t3 + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..92bc97a3f7c9 --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,43 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + x."Join_1" +FROM + ( + SELECT + ( + SELECT + Coalesce(LISTAGG(CASE + WHEN t1."item" LIKE '%A%' ESCAPE '~' THEN t1."item" + ELSE NULL + END, ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + ) as "Join_1" + FROM + "SampleClass" t + ) x +WHERE + NOT (x."Join_1" IS NULL OR LTRIM(x."Join_1", ' + …             

  ') IS NULL) + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..a3c8e082123a --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..a3c8e082123a --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..a3c8e082123a --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.18.Managed.LinqService).sql new file mode 100644 index 000000000000..e2d7b24ffc64 --- /dev/null +++ b/Oracle.18.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.18.Managed.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + g_1."Id", + LISTAGG(Coalesce(g_1."NullableValue", ''), ', '), + LISTAGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed.LinqService).sql index e62cc1c426d4..8374137d3f36 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed.LinqService).sql @@ -7,30 +7,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed.LinqService).sql index 71a4c5d99fca..e244250b6f3d 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed.LinqService).sql @@ -7,30 +7,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.18.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed.LinqService).sql index d1edf37a9bf5..1f5bc9c8936c 100644 --- a/Oracle.18.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed.LinqService).sql @@ -2,12 +2,12 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_1.COUNT_1 + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1.COUNT_1 > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/Oracle.18.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Oracle.18.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 26ad9ddb2a77..7078360ec238 100644 --- a/Oracle.18.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Oracle.18.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1.ID, - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1.ID = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" + m_1.ID = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed.LinqService).sql index 245b227240ca..1c9d3a556131 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1.SUM_1 + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed.LinqService).sql index f39693f45867..fb1aa9647eb7 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x.SUM_1 + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" a_Children_1 WHERE o."ParentID" = a_Children_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" o ) x diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed.LinqService).sql index 5fe3fd6e0429..7e511111d2fa 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY t1."ParentID" HAVING - SUM(t1."ParentID") <> 36 + SUM(t1."ParentID") <> 36 OR SUM(t1."ParentID") IS NULL diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed.LinqService).sql index f5abf2a5a6ff..3b393395ca0d 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY g_1."ParentID" HAVING - SUM(g_1."ParentID") <> 36 + SUM(g_1."ParentID") <> 36 OR SUM(g_1."ParentID") IS NULL diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed.LinqService).sql index a1c9a7a21c1f..77b1690a7db4 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(CAST(pcc."PeriodOrderLimit" AS Int),0) as "MaxCapacity", - COALESCE(COALESCE(vsp.SUM_1,0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as SUM_1 + SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed.LinqService).sql index 40508898789c..ca3b2f40627a 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)), - t1.SUM_1, + t1."SubSum", CASE WHEN EXISTS( SELECT @@ -38,12 +38,12 @@ FROM LEFT JOIN "Parent" a_Parent ON c_1."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = f."ParentID" AND (a_Parent."Value1" = f."Value1" OR a_Parent."Value1" IS NULL AND f."Value1" IS NULL) - ) as SUM_1, + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)) LIKE '%1%' ESCAPE '~' AND - t1.SUM_1 > 0 + t1."SubSum" > 0 diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed.LinqService).sql index df609963727b..fcf27ff153da 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2.SUM_1 + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed.LinqService).sql index f7d7043a635c..49a887eb1218 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1.SUM_1, + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.18.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed.LinqService).sql index d375b2c864f5..b0d1098b19ef 100644 --- a/Oracle.18.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as MAX_1 + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1.MAX_1 OR x."LanguageID" IS NULL AND t1.MAX_1 IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed.LinqService).sql index c8e884c3c436..6e203d9f7725 100644 --- a/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed.LinqService).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed.LinqService).sql b/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed.LinqService).sql index c8e884c3c436..6e203d9f7725 100644 --- a/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed.LinqService).sql +++ b/Oracle.18.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed.LinqService).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/Oracle.18.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.18.Managed).sql index 2d2884d27896..f0271417da7e 100644 --- a/Oracle.18.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.18.Managed).sql @@ -38,7 +38,7 @@ SELECT "AllTypes" t2 WHERE t2.ID = 1000 AND t2."guidDataType" = :val - ) as COUNT_1 + ) as "Count_1" FROM "AllTypes" t1 WHERE diff --git a/Oracle.18.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.18.Managed).sql new file mode 100644 index 000000000000..db5806153be4 --- /dev/null +++ b/Oracle.18.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.18.Managed).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/Oracle.18.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.18.Managed).sql new file mode 100644 index 000000000000..4810e9919a5b --- /dev/null +++ b/Oracle.18.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.18.Managed).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + ( + SELECT + MIN(a_Children."ParentID") + FROM + "Child" a_Children + WHERE + p."ParentID" = a_Children."ParentID" AND a_Children."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/Oracle.18.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed).sql index 662a555de68e..6218b1900230 100644 --- a/Oracle.18.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.18.Managed).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ p."ParentID", p."Value1", - t1.COUNT_1 + t1."Count_1" FROM ( SELECT /*+ QB_NAME(Inline) */ c_1."ParentID", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.18.Managed).sql index 791b46d856e0..62c75f86df6b 100644 --- a/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.18.Managed).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT t1."Key_1", - t1.COUNT_1, + t1."Count_1", t1."window_1" FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", COUNT(*) OVER() as "window_1" FROM "Child" g_1 diff --git a/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.18.Managed).sql index 791b46d856e0..62c75f86df6b 100644 --- a/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.18.Managed).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT t1."Key_1", - t1.COUNT_1, + t1."Count_1", t1."window_1" FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", COUNT(*) OVER() as "window_1" FROM "Child" g_1 diff --git a/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.18.Managed).sql index c4ca37699ca3..05a8d630f0ab 100644 --- a/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.18.Managed).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT t1."Key_1", - t1.COUNT_1, + t1."Count_1", t1."window_1" FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", COUNT(*) OVER() as "window_1" FROM "Child" g_1 diff --git a/Oracle.18.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed).sql index a9537f7320c4..da8ca7f19bd0 100644 --- a/Oracle.18.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.18.Managed).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt.ID) <> 0 + SUM(tt.ID) <> 0 OR SUM(tt.ID) IS NULL diff --git a/Oracle.18.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed,False).sql b/Oracle.18.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed,False).sql index 9496772c2637..8c126d031a31 100644 --- a/Oracle.18.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed,False).sql +++ b/Oracle.18.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.18.Managed,False).sql @@ -2,27 +2,23 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 DECLARE @In_1 Varchar2 -- String SET @In_1 = NULL -DECLARE @In_2 Varchar2 -- String -SET @In_2 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In_1, :In_2) + s."CEnum" IN (:In_1, :In_1) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 DECLARE @NotIn Varchar2 -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar2 -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed).sql index e7aee1071c1c..0933d30aa5a5 100644 --- a/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.18.Managed).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed).sql index e7aee1071c1c..0933d30aa5a5 100644 --- a/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.18.Managed).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.18.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed).sql index 8be072fcc4fa..7450a1f3fff3 100644 --- a/Oracle.18.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.18.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - p.ID + CAST(CAST(p.ID AS Number(3)) AS VarChar(255)) FROM "LinqDataTypes" p WHERE diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed).sql index c18c412a8882..919578714b60 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.18.Managed).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed).sql index 01508ba832ca..090586e48a64 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.18.Managed).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed).sql index 88680c750560..59030652183d 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.18.Managed).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed).sql index cf0b8c78e111..aa4327c33944 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.18.Managed).sql @@ -2,22 +2,22 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed).sql index cf0b8c78e111..aa4327c33944 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.18.Managed).sql @@ -2,22 +2,22 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed).sql index 54ddd138c513..9af42ff5002c 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.18.Managed).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed).sql index 329f562691f8..9da5e0e8eb00 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.18.Managed).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed).sql index da82e6bc765d..c59a9ae083dc 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.18.Managed).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed).sql index 057d904e3cb3..68670a255fc4 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.18.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t2.COUNT_1 + t2.COUNT_1 + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as COUNT_1 + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed).sql index d6c338137658..2aa3d7658c36 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.18.Managed).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed).sql index d6c338137658..2aa3d7658c36 100644 --- a/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.18.Managed).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.18.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed).sql index 76ffd94d263b..7d948a3f9dda 100644 --- a/Oracle.18.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.18.Managed).sql @@ -5,7 +5,7 @@ SET @take = 5 SELECT g_2."Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.18.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed).sql index 002316663b4d..279bd1ff7f80 100644 --- a/Oracle.18.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.18.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t2.SUM_1 + t2."Sum_1" FROM "Parent" p OUTER APPLY ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN d."ParentID" IS NOT NULL THEN d."ParentID" ELSE -100 - END) as SUM_1 + END) as "Sum_1" FROM ( SELECT diff --git a/Oracle.18.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.18.Managed).sql new file mode 100644 index 000000000000..57d1fe42294c --- /dev/null +++ b/Oracle.18.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.18.Managed).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed).sql index 8cf4ec437a14..76f6b6f87b54 100644 --- a/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.18.Managed).sql @@ -2,13 +2,13 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t3.SUM_1, - t6.COUNT_1 + t3."Sum_1", + t6."Count_1" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - SUM(t2."DetailId") as SUM_1 + SUM(t2."DetailId") as "Sum_1" FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) t3 OUTER APPLY ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed).sql index 717f21328017..0e7af1b88d3f 100644 --- a/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.18.Managed).sql @@ -2,12 +2,12 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t3.AVG_1 + t3."Average" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - AVG(CAST(t2."DetailId" AS Float)) as AVG_1 + AVG(CAST(t2."DetailId" AS Float)) as "Average" FROM ( SELECT diff --git a/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.18.Managed).sql index 8e70fe41a42d..c526c4b509ad 100644 --- a/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.18.Managed).sql @@ -2,7 +2,6 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - it_1."cond_1", it_1."cond", it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" a_Style ON t3."StyleId" = a_Style."Id" LEFT JOIN ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as "cond", it."StyleName", it."Conditional", it."field1", it."field2", it."field3", - 1 as "cond_1" + 1 as "cond" FROM ( - SELECT a_Color."Name" AS "ColorName", t2.COUNT_1 AS "Count", 0 AS "index", a_Style."Name" AS "StyleName", CASE - WHEN a_Color."Name" = 'Red' THEN t2.COUNT_1 + SELECT a_Color."Name" AS "ColorName", t2."Count_1" AS "Count", a_Style."Name" AS "StyleName", CASE + WHEN a_Color."Name" = 'Red' THEN t2."Count_1" ELSE 0 END AS "Conditional", 1 AS "field1", 2 AS "field2", 3 AS "field3" FROM sys.dual UNION ALL - SELECT NULL, 0, 1, a_Style."Name", NULL, 4, 5, 6 FROM sys.dual) it + SELECT NULL, 0, a_Style."Name", NULL, 4, 5, 6 FROM sys.dual) it ) it_1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" a_Color ON t3."ColorId" = a_Color."Id" LEFT JOIN ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 OUTER APPLY ( - SELECT a_Color."Name" AS "ColorName", t2.COUNT_1 AS "Count", CASE - WHEN a_Color."Name" = 'Red' THEN t2.COUNT_1 + SELECT a_Color."Name" AS "ColorName", t2."Count_1" AS "Count", CASE + WHEN a_Color."Name" = 'Red' THEN t2."Count_1" ELSE 0 END AS "Conditional" FROM sys.dual UNION ALL diff --git a/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.18.Managed).sql index 103a9d4fcbd8..e14e9afe3b69 100644 --- a/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.18.Managed).sql @@ -20,7 +20,7 @@ FROM ( SELECT a_Color."Name" AS "ColorName", a_Style."Name" AS "StyleName", ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) AS "Count" FROM sys.dual diff --git a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed).sql index 0744cacef285..9cbca24d2399 100644 --- a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.18.Managed).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 0 ) FROM "Parent" p diff --git a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed).sql index e47c5675637d..4325282b28a0 100644 --- a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.18.Managed).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 1 ) FROM "Parent" p diff --git a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed).sql index ac11605dbdcb..9a7e12d81f77 100644 --- a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.18.Managed).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed).sql index 81fb863e308e..e2ef999189cd 100644 --- a/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.18.Managed).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed).sql index 588db941453e..afc63e0423c5 100644 --- a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.18.Managed).sql @@ -2,97 +2,41 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t7."Key_1", - t7.COUNT_1, - t7.COUNT_2, - t7.COUNT_3, - t7.COUNT_4, - t1.COUNT_1, - t3.COUNT_1, - t4.COUNT_1, - t7.COUNT_5, - t6.COUNT_1 + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as COUNT_1, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_2, - COUNT(*) as COUNT_3, - COUNT(DISTINCT t."DataValue") as COUNT_4, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_5 - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t7 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t7."Key_1" = x."GroupId" - ) x_1 - WHERE - MOD(x_1."DataValue", 2) = 0D - ) t1 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t7."Key_1" = t_1."GroupId" AND - MOD(t_1."DataValue", 2) = 0D - ) t2 - ) t3 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t7."Key_1" = x_2."GroupId" AND - MOD(x_2."DataValue", 2) = 0D - ) x_3 - WHERE - MOD(x_3."DataValue", 2) = 0D - ) t4 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t7."Key_1" = t_2."GroupId" AND - MOD(t_2."DataValue", 2) = 0D - ) t5 - ) t6 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 diff --git a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed).sql index 04d3c54ccb95..42968a9cfd2c 100644 --- a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.18.Managed).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent."ParentID", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", a_Parent."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM a_Parent."Value1" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed).sql index 4f274284af06..1fff79964294 100644 --- a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.18.Managed).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN t."Status" = 3 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Issue1192Table" t WHERE diff --git a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed).sql index 8ba37ebef18f..d507f1f59b75 100644 --- a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.18.Managed).sql @@ -2,23 +2,23 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - g_2.MIN_2 + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1, + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_2 + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed).sql index 2456205b1e93..f22bf2519526 100644 --- a/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.18.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - g_2.MIN_1 + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1 + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed).sql index e222b7a40c86..b7245137eb5a 100644 --- a/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.18.Managed).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed).sql index 6e022052a68b..0fcb73676600 100644 --- a/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.18.Managed).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed).sql index 103e9b602d5a..4352340b3a40 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.18.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed).sql index 35900f22bf38..0b52b6247d14 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.18.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed).sql index 6399e263333c..8176c2567410 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.18.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,1).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,1).sql index 7d443692de06..f7aee23b31f7 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,1).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,2).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,2).sql index 7d443692de06..f7aee23b31f7 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,2).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,1).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,1).sql index 35900f22bf38..0b52b6247d14 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,1).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,1).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,2).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,2).sql index 35900f22bf38..0b52b6247d14 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,2).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.18.Managed,ToEven,2).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed).sql index 3177ad4025db..30563e7a68c0 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.18.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed).sql index 35900f22bf38..0b52b6247d14 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.18.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed).sql index 6399e263333c..8176c2567410 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.18.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed).sql index c6afae979e57..e239ca748ae1 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.18.Managed).sql @@ -2,9 +2,14 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue") as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed).sql index c5d546a35447..1c2ab022d3d8 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.18.Managed).sql @@ -2,9 +2,14 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(CAST(p."MoneyValue" AS Float)) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(CAST(t."MoneyValue" AS Float)) <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed).sql index 103e9b602d5a..4352340b3a40 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.18.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed).sql index 3177ad4025db..30563e7a68c0 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.18.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed).sql index 4281946923d1..7b845f6a4bea 100644 --- a/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.18.Managed).sql @@ -2,9 +2,14 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue", 1) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t."c1" <> 0 diff --git a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed).sql index 341a2354e88b..1077f84b8e48 100644 --- a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.18.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed).sql index 341a2354e88b..1077f84b8e48 100644 --- a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.18.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed).sql index 49d6f344850d..f564d81e8892 100644 --- a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.18.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed).sql index 49d6f344850d..f564d81e8892 100644 --- a/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.18.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.18.Managed Oracle.Managed Oracle12 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.18.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed).sql index f2ca2b4858e4..fddfc29ec0a8 100644 --- a/Oracle.18.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.18.Managed).sql @@ -4,9 +4,9 @@ DECLARE @take Int32 SET @take = 1 SELECT - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", 1 + MIN(g_1."ChildID") as "c1", - MAX(g_1."ChildID") as MAX_1 + MAX(g_1."ChildID") as "Max_1" FROM "Child" g_1 FETCH NEXT :take ROWS ONLY diff --git a/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed).sql index 718fc0b53967..a11d77db2a2d 100644 --- a/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.18.Managed).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed).sql index 157cbdc19af8..5614d3792fe8 100644 --- a/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.18.Managed).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID" as "id", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed).sql index 718fc0b53967..a11d77db2a2d 100644 --- a/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.18.Managed).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.18.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed).sql index 44d6b889211a..0d38f1917c45 100644 --- a/Oracle.18.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.18.Managed).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x.MAX_1 + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as MAX_1 + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.18.Managed).sql new file mode 100644 index 000000000000..5eafd1486b5d --- /dev/null +++ b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.18.Managed).sql @@ -0,0 +1,53 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + ( + SELECT + Coalesce(LISTAGG(t4."item", ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t4 + ), + t3."Join_1" +FROM + "SampleClass" t + OUTER APPLY ( + SELECT + LISTAGG(Coalesce(t2."item_1", ''), ', ') WITHIN GROUP (ORDER BY t2."item_1") as "Join_1" + FROM + ( + SELECT DISTINCT + t1."item" as "item_1" + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + WHERE + t1."item" IS NOT NULL + ) t2 + ) t3 + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.18.Managed).sql new file mode 100644 index 000000000000..0a3298a20c8c --- /dev/null +++ b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.18.Managed).sql @@ -0,0 +1,43 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + x."Join_1" +FROM + ( + SELECT + ( + SELECT + Coalesce(LISTAGG(CASE + WHEN t1."item" LIKE '%A%' ESCAPE '~' THEN t1."item" + ELSE NULL + END, ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + ) as "Join_1" + FROM + "SampleClass" t + ) x +WHERE + NOT (x."Join_1" IS NULL OR LTRIM(x."Join_1", ' + …             

  ') IS NULL) + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.18.Managed).sql new file mode 100644 index 000000000000..fc2a07993ec4 --- /dev/null +++ b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.18.Managed).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.18.Managed).sql new file mode 100644 index 000000000000..a3c8e082123a --- /dev/null +++ b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.18.Managed).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.18.Managed).sql new file mode 100644 index 000000000000..fc2a07993ec4 --- /dev/null +++ b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.18.Managed).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.18.Managed).sql new file mode 100644 index 000000000000..c7cc7aa08931 --- /dev/null +++ b/Oracle.18.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.18.Managed).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + g_1."Id", + LISTAGG(Coalesce(g_1."NullableValue", ''), ', '), + LISTAGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- Oracle.18.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed).sql index e20405d50ee5..2568c9a33acd 100644 --- a/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.18.Managed).sql @@ -9,30 +9,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute DisposeTransaction diff --git a/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed).sql index a1ff245e3957..d6b7b500992d 100644 --- a/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.18.Managed).sql @@ -9,30 +9,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute DisposeTransaction diff --git a/Oracle.18.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed).sql index c54feda5d3ca..1fa7b1da648a 100644 --- a/Oracle.18.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.18.Managed).sql @@ -2,12 +2,12 @@ -- Oracle.18.Managed Oracle.Managed Oracle12 SELECT - g_1.COUNT_1 + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1.COUNT_1 > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/Oracle.18.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Oracle.18.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index b7dd43d0a031..f9c5fd644292 100644 --- a/Oracle.18.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Oracle.18.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.18.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1.ID, - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1.ID = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" + m_1.ID = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed).sql index 3a7df0e301c2..3124b4807fee 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.18.Managed).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1.SUM_1 + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed).sql index 104c2ee4d154..3cfed42ee9ca 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.18.Managed).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x.SUM_1 + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" a_Children_1 WHERE o."ParentID" = a_Children_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" o ) x diff --git a/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed).sql index 2e5cf32e9319..16edec14b898 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.18.Managed).sql @@ -9,5 +9,5 @@ FROM GROUP BY t1."ParentID" HAVING - SUM(t1."ParentID") <> 36 + SUM(t1."ParentID") <> 36 OR SUM(t1."ParentID") IS NULL diff --git a/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.18.Managed).sql index 2e5cf32e9319..16edec14b898 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.18.Managed).sql @@ -9,5 +9,5 @@ FROM GROUP BY t1."ParentID" HAVING - SUM(t1."ParentID") <> 36 + SUM(t1."ParentID") <> 36 OR SUM(t1."ParentID") IS NULL diff --git a/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed).sql index 331f34945da7..fcb0e7515ed1 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.18.Managed).sql @@ -9,5 +9,5 @@ FROM GROUP BY g_1."ParentID" HAVING - SUM(g_1."ParentID") <> 36 + SUM(g_1."ParentID") <> 36 OR SUM(g_1."ParentID") IS NULL diff --git a/Oracle.18.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.18.Managed).sql index 222d4b4b6f96..1fae68e5e457 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.18.Managed).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + a_Parent."ParentID" FROM - ( - SELECT - a_Parent."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" a_Parent ON t1."ParentID" = a_Parent."ParentID" - FETCH NEXT 1 ROWS ONLY - ) t2 + "Child" t1 + LEFT JOIN "Parent" a_Parent ON t1."ParentID" = a_Parent."ParentID" + FETCH NEXT 1 ROWS ONLY ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/Oracle.18.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed).sql index 1b97be5388bf..c903ea10d539 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.18.Managed).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(CAST(pcc."PeriodOrderLimit" AS Int),0) as "MaxCapacity", - COALESCE(COALESCE(vsp.SUM_1,0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as SUM_1 + SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/Oracle.18.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed).sql index 39419a70ad30..ad5d9ef9810d 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.18.Managed).sql @@ -3,7 +3,7 @@ SELECT ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)), - t1.SUM_1, + t1."SubSum", CASE WHEN EXISTS( SELECT @@ -38,12 +38,12 @@ FROM LEFT JOIN "Parent" a_Parent ON c_1."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = f."ParentID" AND (a_Parent."Value1" = f."Value1" OR a_Parent."Value1" IS NULL AND f."Value1" IS NULL) - ) as SUM_1, + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)) LIKE '%1%' ESCAPE '~' AND - t1.SUM_1 > 0 + t1."SubSum" > 0 diff --git a/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed).sql index fe5cb7a5283e..f1f2172432b4 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.18.Managed).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2.SUM_1 + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed).sql index 87f4d42ebe2b..0cb3b4ece7cf 100644 --- a/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.18.Managed).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1.SUM_1, + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.18.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed).sql index b8c66e3aed3c..4bb6ad5420a1 100644 --- a/Oracle.18.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.18.Managed).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as MAX_1 + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1.MAX_1 OR x."LanguageID" IS NULL AND t1.MAX_1 IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed).sql index f85003702103..a276505c7da6 100644 --- a/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.18.Managed).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed).sql b/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed).sql index f85003702103..a276505c7da6 100644 --- a/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed).sql +++ b/Oracle.18.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.18.Managed).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/Oracle.19.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..bfac2f0bdd7f --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/Oracle.19.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..f547850f59c1 --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + ( + SELECT + MIN(a_Children."ParentID") + FROM + "Child" a_Children + WHERE + p."ParentID" = a_Children."ParentID" AND a_Children."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/Oracle.19.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed.LinqService).sql index 8ce0f28ca5b5..111fffa6dd6f 100644 --- a/Oracle.19.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed.LinqService).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ p."ParentID", p."Value1", - t1.COUNT_1 + t1."Count_1" FROM ( SELECT /*+ QB_NAME(Inline) */ c_1."ParentID", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed.LinqService).sql index 10e3dc9d9f63..3d425bb8ba14 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt.ID) <> 0 + SUM(tt.ID) <> 0 OR SUM(tt.ID) IS NULL diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed.LinqService,False).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed.LinqService,False).sql index f5d2a5a488a5..ac790c22ca72 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed.LinqService,False).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed.LinqService,False).sql @@ -2,27 +2,23 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) DECLARE @In_1 Varchar2 -- String SET @In_1 = NULL -DECLARE @In_2 Varchar2 -- String -SET @In_2 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In_1, :In_2) + s."CEnum" IN (:In_1, :In_1) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) DECLARE @NotIn Varchar2 -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar2 -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed.LinqService).sql index 086518a7fe7b..2c62d78f279e 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed.LinqService).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed.LinqService).sql index 086518a7fe7b..2c62d78f279e 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed.LinqService).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed.LinqService).sql index e0f23c8ee1ee..0f0648a465cf 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - p.ID + CAST(CAST(p.ID AS Number(3)) AS VarChar(255)) FROM "LinqDataTypes" p WHERE diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed.LinqService).sql index 794fc415b4ef..4dd60f35ff47 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed.LinqService).sql index 48281fe52980..a1092f6de357 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed.LinqService).sql index 98af73a66056..001a91d32210 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed.LinqService).sql index b503f091a2ad..108bf6bbd693 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed.LinqService).sql @@ -2,22 +2,22 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed.LinqService).sql index b503f091a2ad..108bf6bbd693 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed.LinqService).sql @@ -2,22 +2,22 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed.LinqService).sql index c09c97ae52bd..731daa7f380d 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed.LinqService).sql index e0b1a4aade59..4de27185ba91 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed.LinqService).sql index 4478be5e3f68..dc8b6df7f6bb 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed.LinqService).sql index e6769fec719e..70579ded1fbb 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t2.COUNT_1 + t2.COUNT_1 + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as COUNT_1 + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed.LinqService).sql index 3c3c0b4e38d7..3577fa025aa8 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed.LinqService).sql index 3c3c0b4e38d7..3577fa025aa8 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed.LinqService).sql index 23544080e3ed..7e59789b1c9b 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed.LinqService).sql @@ -5,7 +5,7 @@ SET @take = 5 SELECT g_2."Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed.LinqService).sql index 459ebe5f47cb..f55fa7e645f2 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t2.SUM_1 + t2."Sum_1" FROM "Parent" p OUTER APPLY ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN d."ParentID" IS NOT NULL THEN d."ParentID" ELSE -100 - END) as SUM_1 + END) as "Sum_1" FROM ( SELECT diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..adfa11edd8e3 --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed.LinqService).sql index 31c534c51d3f..e49cdd285d83 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed.LinqService).sql @@ -2,13 +2,13 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t3.SUM_1, - t6.COUNT_1 + t3."Sum_1", + t6."Count_1" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - SUM(t2."DetailId") as SUM_1 + SUM(t2."DetailId") as "Sum_1" FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) t3 OUTER APPLY ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed.LinqService).sql index 8c727963627b..eee4bb93a042 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed.LinqService).sql @@ -2,12 +2,12 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t3.AVG_1 + t3."Average" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - AVG(CAST(t2."DetailId" AS Float)) as AVG_1 + AVG(CAST(t2."DetailId" AS Float)) as "Average" FROM ( SELECT diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed.LinqService).sql index 111b40a32ffb..01c234e42dae 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 0 ) FROM "Parent" p diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed.LinqService).sql index a4cab966caaa..a8f60b5edae5 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 1 ) FROM "Parent" p diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed.LinqService).sql index efcec7484fbb..544721358a70 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed.LinqService).sql index 9d67e267ad45..366b692ead33 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed.LinqService).sql index bbbe255dbf7e..9816ae083c28 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed.LinqService).sql @@ -2,97 +2,41 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t7."Key_1", - t7.COUNT_1, - t7.COUNT_2, - t7.COUNT_3, - t7.COUNT_4, - t1.COUNT_1, - t3.COUNT_1, - t4.COUNT_1, - t7.COUNT_5, - t6.COUNT_1 + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as COUNT_1, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_2, - COUNT(*) as COUNT_3, - COUNT(DISTINCT t."DataValue") as COUNT_4, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_5 - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t7 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t7."Key_1" = x."GroupId" - ) x_1 - WHERE - MOD(x_1."DataValue", 2) = 0D - ) t1 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t7."Key_1" = t_1."GroupId" AND - MOD(t_1."DataValue", 2) = 0D - ) t2 - ) t3 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t7."Key_1" = x_2."GroupId" AND - MOD(x_2."DataValue", 2) = 0D - ) x_3 - WHERE - MOD(x_3."DataValue", 2) = 0D - ) t4 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t7."Key_1" = t_2."GroupId" AND - MOD(t_2."DataValue", 2) = 0D - ) t5 - ) t6 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed.LinqService).sql index adca0ebba050..7e1fb7e6b209 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent."ParentID", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", a_Parent."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM a_Parent."Value1" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed.LinqService).sql index 869672a1fb09..47ae468b0b0c 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed.LinqService).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN t."Status" = 3 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Issue1192Table" t WHERE diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed.LinqService).sql index f5936fd0f923..cb97840064b6 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed.LinqService).sql @@ -2,23 +2,23 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MIN_2 + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1, + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_2 + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed.LinqService).sql index 3810dee13b42..41c7be0334f0 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_2.MIN_1 + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1 + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed.LinqService).sql index 8d2cd72813a8..add1c3725897 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed.LinqService).sql index 9c1ac8c9d353..837d9f894267 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed.LinqService).sql index 89c951446054..e49cb41d5320 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed.LinqService).sql index 8586625c4391..3829e72270cc 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed.LinqService).sql index b632afb4849e..bf62e6d9d4d0 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,1).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,1).sql index 6c466ad78c80..36b799ac522d 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,1).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,2).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,2).sql index 6c466ad78c80..36b799ac522d 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,2).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,1).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,1).sql index 8586625c4391..3829e72270cc 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,1).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,2).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,2).sql index 8586625c4391..3829e72270cc 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,2).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed.LinqService).sql index 36a332da5dcd..eec769da2056 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed.LinqService).sql index 8586625c4391..3829e72270cc 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed.LinqService).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed.LinqService).sql index b632afb4849e..bf62e6d9d4d0 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed.LinqService).sql index 4e9cca775b77..f4028443ce56 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed.LinqService).sql @@ -2,9 +2,14 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue") as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed.LinqService).sql index d5f3405ab14f..705945971be0 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed.LinqService).sql @@ -2,9 +2,14 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(CAST(p."MoneyValue" AS Float)) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(CAST(t."MoneyValue" AS Float)) <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed.LinqService).sql index 89c951446054..e49cb41d5320 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed.LinqService).sql index 36a332da5dcd..eec769da2056 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed.LinqService).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed.LinqService).sql index ec161fa43e31..0f1b8ed02379 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed.LinqService).sql @@ -2,9 +2,14 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue", 1) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed.LinqService).sql index ce7ff6bcd56d..be884bb2cadd 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed.LinqService).sql index ce7ff6bcd56d..be884bb2cadd 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed.LinqService).sql index a338e9f27092..9d3b542b62f6 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed.LinqService).sql index a338e9f27092..9d3b542b62f6 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed.LinqService).sql index 263977086fbb..a915e2deecc2 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed.LinqService).sql @@ -4,9 +4,9 @@ DECLARE @take Int32 SET @take = 1 SELECT - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", 1 + MIN(g_1."ChildID") as "c1", - MAX(g_1."ChildID") as MAX_1 + MAX(g_1."ChildID") as "Max_1" FROM "Child" g_1 FETCH NEXT :take ROWS ONLY diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed.LinqService).sql index 130177f1f76c..46de151db6db 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed.LinqService).sql index e26224f476e8..cfcbf29e71d5 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID" as "id", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed.LinqService).sql index 130177f1f76c..46de151db6db 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed.LinqService).sql index bc5b7e1479a8..421f4add6794 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x.MAX_1 + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as MAX_1 + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..684bfca50a45 --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,53 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + ( + SELECT + Coalesce(LISTAGG(t4."item", ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t4 + ), + t3."Join_1" +FROM + "SampleClass" t + OUTER APPLY ( + SELECT + LISTAGG(Coalesce(t2."item_1", ''), ', ') WITHIN GROUP (ORDER BY t2."item_1") as "Join_1" + FROM + ( + SELECT DISTINCT + t1."item" as "item_1" + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + WHERE + t1."item" IS NOT NULL + ) t2 + ) t3 + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..75c44293f37e --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,43 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + x."Join_1" +FROM + ( + SELECT + ( + SELECT + Coalesce(LISTAGG(CASE + WHEN t1."item" LIKE '%A%' ESCAPE '~' THEN t1."item" + ELSE NULL + END, ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + ) as "Join_1" + FROM + "SampleClass" t + ) x +WHERE + NOT (x."Join_1" IS NULL OR LTRIM(x."Join_1", ' + …             

  ') IS NULL) + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..aa33019c3496 --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..aa33019c3496 --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..aa33019c3496 --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.19.Managed.LinqService).sql new file mode 100644 index 000000000000..333b9f4f4556 --- /dev/null +++ b/Oracle.19.Managed.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.19.Managed.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + g_1."Id", + LISTAGG(Coalesce(g_1."NullableValue", ''), ', '), + LISTAGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed.LinqService).sql index 4f04bb8da90a..bccb38261a84 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed.LinqService).sql @@ -7,30 +7,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed.LinqService).sql index b260c8b9d335..8ef329a11739 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed.LinqService).sql @@ -7,30 +7,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.19.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed.LinqService).sql index a99cd6386647..af906f7c77f7 100644 --- a/Oracle.19.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed.LinqService).sql @@ -2,12 +2,12 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) SELECT - g_1.COUNT_1 + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1.COUNT_1 > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/Oracle.19.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Oracle.19.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 9d44b8402f44..7e40c200505a 100644 --- a/Oracle.19.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Oracle.19.Managed.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1.ID, - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1.ID = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" + m_1.ID = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed.LinqService).sql index 182f157f8076..7800de7a3659 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1.SUM_1 + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed.LinqService).sql index bc02b5a6f11b..9957d6974123 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x.SUM_1 + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" a_Children_1 WHERE o."ParentID" = a_Children_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" o ) x diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed.LinqService).sql index d7b5c89a0278..4785150641cb 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY t1."ParentID" HAVING - SUM(t1."ParentID") <> 36 + SUM(t1."ParentID") <> 36 OR SUM(t1."ParentID") IS NULL diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed.LinqService).sql index 51a54d572e16..949a991180f6 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY g_1."ParentID" HAVING - SUM(g_1."ParentID") <> 36 + SUM(g_1."ParentID") <> 36 OR SUM(g_1."ParentID") IS NULL diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed.LinqService).sql index 9ed49ed8f743..1cd56c0527ff 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(CAST(pcc."PeriodOrderLimit" AS Int),0) as "MaxCapacity", - COALESCE(COALESCE(vsp.SUM_1,0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as SUM_1 + SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed.LinqService).sql index cdd55fc3e9ed..265a30fe5f12 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)), - t1.SUM_1, + t1."SubSum", CASE WHEN EXISTS( SELECT @@ -38,12 +38,12 @@ FROM LEFT JOIN "Parent" a_Parent ON c_1."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = f."ParentID" AND (a_Parent."Value1" = f."Value1" OR a_Parent."Value1" IS NULL AND f."Value1" IS NULL) - ) as SUM_1, + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)) LIKE '%1%' ESCAPE '~' AND - t1.SUM_1 > 0 + t1."SubSum" > 0 diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed.LinqService).sql index eed75ded66df..c551071b35e8 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2.SUM_1 + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed.LinqService).sql index 46af05b6c418..aeaa1aee399b 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1.SUM_1, + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.19.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed.LinqService).sql index edcfaa01b59d..6124e3990cec 100644 --- a/Oracle.19.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as MAX_1 + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1.MAX_1 OR x."LanguageID" IS NULL AND t1.MAX_1 IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed.LinqService).sql index bd1f6aebf9a2..5a1ab73093db 100644 --- a/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed.LinqService).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed.LinqService).sql b/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed.LinqService).sql index bd1f6aebf9a2..5a1ab73093db 100644 --- a/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed.LinqService).sql +++ b/Oracle.19.Managed.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed.LinqService).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/Oracle.19.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.19.Managed).sql index 5078baf8a6d4..3e0eb9e635d8 100644 --- a/Oracle.19.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/DataProvider/OracleTests/Tests.DataProvider.OracleTests.Issue539(Oracle.19.Managed).sql @@ -38,7 +38,7 @@ SELECT "AllTypes" t2 WHERE t2.ID = 1000 AND t2."guidDataType" = :val - ) as COUNT_1 + ) as "Count_1" FROM "AllTypes" t1 WHERE diff --git a/Oracle.19.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.19.Managed).sql new file mode 100644 index 000000000000..36ca3f410bdf --- /dev/null +++ b/Oracle.19.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(Oracle.19.Managed).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/Oracle.19.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.19.Managed).sql new file mode 100644 index 000000000000..2b240e425cd4 --- /dev/null +++ b/Oracle.19.Managed/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(Oracle.19.Managed).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + ( + SELECT + MIN(a_Children."ParentID") + FROM + "Child" a_Children + WHERE + p."ParentID" = a_Children."ParentID" AND a_Children."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/Oracle.19.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed).sql index b74f37396b57..bcc2f1cda8ac 100644 --- a/Oracle.19.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(Oracle.19.Managed).sql @@ -4,12 +4,12 @@ SELECT /*+ QB_NAME(Main) */ p."ParentID", p."Value1", - t1.COUNT_1 + t1."Count_1" FROM ( SELECT /*+ QB_NAME(Inline) */ c_1."ParentID", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.19.Managed).sql index 0f059819ea6d..f65bc28adda7 100644 --- a/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(Oracle.19.Managed).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT t1."Key_1", - t1.COUNT_1, + t1."Count_1", t1."window_1" FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", COUNT(*) OVER() as "window_1" FROM "Child" g_1 diff --git a/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.19.Managed).sql index 0f059819ea6d..f65bc28adda7 100644 --- a/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(Oracle.19.Managed).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT t1."Key_1", - t1.COUNT_1, + t1."Count_1", t1."window_1" FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", COUNT(*) OVER() as "window_1" FROM "Child" g_1 diff --git a/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.19.Managed).sql index 3bb6d3e6dc11..0883e3fb5c69 100644 --- a/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(Oracle.19.Managed).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT t1."Key_1", - t1.COUNT_1, + t1."Count_1", t1."window_1" FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", COUNT(*) OVER() as "window_1" FROM "Child" g_1 diff --git a/Oracle.19.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed).sql index 6ea640603825..8ce09d6dfbd4 100644 --- a/Oracle.19.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(Oracle.19.Managed).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt.ID) <> 0 + SUM(tt.ID) <> 0 OR SUM(tt.ID) IS NULL diff --git a/Oracle.19.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed,False).sql b/Oracle.19.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed,False).sql index 22b05fa2addc..41057bd10ea0 100644 --- a/Oracle.19.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed,False).sql +++ b/Oracle.19.Managed/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(Oracle.19.Managed,False).sql @@ -2,27 +2,23 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 DECLARE @In_1 Varchar2 -- String SET @In_1 = NULL -DECLARE @In_2 Varchar2 -- String -SET @In_2 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In_1, :In_2) + s."CEnum" IN (:In_1, :In_1) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 DECLARE @NotIn Varchar2 -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar2 -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed).sql index f384ee53fb5c..aa517f7da9fc 100644 --- a/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(Oracle.19.Managed).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed).sql index f384ee53fb5c..aa517f7da9fc 100644 --- a/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(Oracle.19.Managed).sql @@ -24,7 +24,7 @@ SELECT "Child" c_3 WHERE c_3."ParentID" = t."ParentID" AND c_3."ChildID" > -100 - ) as COUNT_1, + ) as "Count_1", ( SELECT c_4."ParentID" diff --git a/Oracle.19.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed).sql index 005f1c7b2721..5adffb7e18e0 100644 --- a/Oracle.19.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(Oracle.19.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - p.ID + CAST(CAST(p.ID AS Number(3)) AS VarChar(255)) FROM "LinqDataTypes" p WHERE diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed).sql index 2ce8884ae078..df9699e0572f 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(Oracle.19.Managed).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed).sql index f779c7a62712..2beffbdf134a 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(Oracle.19.Managed).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed).sql index 7a5177a5aff5..823ae6dfccb8 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(Oracle.19.Managed).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" a_Parent ON p."ParentID" = a_Parent."ParentID" + "Child" ch + INNER JOIN "Parent" a_Parent ON ch."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = 1 diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed).sql index 54b89c11128e..a334d2943485 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(Oracle.19.Managed).sql @@ -2,22 +2,22 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed).sql index 54b89c11128e..a334d2943485 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(Oracle.19.Managed).sql @@ -2,22 +2,22 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - g_2.MAX_1, - g_2.COUNT_1 + 1, - g_2.COUNT_1, - g_2.COUNT_2 + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as MAX_1, + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1, + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as COUNT_2 + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed).sql index 167446b5f850..171a14bc3efc 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(Oracle.19.Managed).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed).sql index 92f31f4bdc9e..737b39517980 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(Oracle.19.Managed).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed).sql index 529ac635c12e..a6cf7bf5bcb9 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(Oracle.19.Managed).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.COUNT_1 > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed).sql index 82485ebea69b..6a7587d4ffcf 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(Oracle.19.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t2.COUNT_1 + t2.COUNT_1 + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as COUNT_1 + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed).sql index fd5446ff5fda..ecf1daca2429 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(Oracle.19.Managed).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed).sql index fd5446ff5fda..ecf1daca2429 100644 --- a/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(Oracle.19.Managed).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children_1 WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = a_Children_1."ParentID" ) END FROM diff --git a/Oracle.19.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed).sql index f0c0083bde14..c58b5c1f2a82 100644 --- a/Oracle.19.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(Oracle.19.Managed).sql @@ -5,7 +5,7 @@ SET @take = 5 SELECT g_2."Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.19.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed).sql index 390041fae94b..aa5e6d66d9d1 100644 --- a/Oracle.19.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(Oracle.19.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t2.SUM_1 + t2."Sum_1" FROM "Parent" p OUTER APPLY ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN d."ParentID" IS NOT NULL THEN d."ParentID" ELSE -100 - END) as SUM_1 + END) as "Sum_1" FROM ( SELECT diff --git a/Oracle.19.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.19.Managed).sql new file mode 100644 index 000000000000..30c8ebd3894f --- /dev/null +++ b/Oracle.19.Managed/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(Oracle.19.Managed).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed).sql index 9f239d81ad53..ab40759c5737 100644 --- a/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(Oracle.19.Managed).sql @@ -2,13 +2,13 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t3.SUM_1, - t6.COUNT_1 + t3."Sum_1", + t6."Count_1" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - SUM(t2."DetailId") as SUM_1 + SUM(t2."DetailId") as "Sum_1" FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) t3 OUTER APPLY ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed).sql index 17104e0c3585..0cc032a6037a 100644 --- a/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(Oracle.19.Managed).sql @@ -2,12 +2,12 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t3.AVG_1 + t3."Average" FROM "MasterClass" m_1 OUTER APPLY ( SELECT - AVG(CAST(t2."DetailId" AS Float)) as AVG_1 + AVG(CAST(t2."DetailId" AS Float)) as "Average" FROM ( SELECT diff --git a/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.19.Managed).sql index 6942b99b21ee..93ac3b4e97e8 100644 --- a/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(Oracle.19.Managed).sql @@ -2,7 +2,6 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - it_1."cond_1", it_1."cond", it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" a_Style ON t3."StyleId" = a_Style."Id" LEFT JOIN ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as "cond", it."StyleName", it."Conditional", it."field1", it."field2", it."field3", - 1 as "cond_1" + 1 as "cond" FROM ( - SELECT a_Color."Name" AS "ColorName", t2.COUNT_1 AS "Count", 0 AS "index", a_Style."Name" AS "StyleName", CASE - WHEN a_Color."Name" = 'Red' THEN t2.COUNT_1 + SELECT a_Color."Name" AS "ColorName", t2."Count_1" AS "Count", a_Style."Name" AS "StyleName", CASE + WHEN a_Color."Name" = 'Red' THEN t2."Count_1" ELSE 0 END AS "Conditional", 1 AS "field1", 2 AS "field2", 3 AS "field3" FROM sys.dual UNION ALL - SELECT NULL, 0, 1, a_Style."Name", NULL, 4, 5, 6 FROM sys.dual) it + SELECT NULL, 0, a_Style."Name", NULL, 4, 5, 6 FROM sys.dual) it ) it_1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" a_Color ON t3."ColorId" = a_Color."Id" LEFT JOIN ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 OUTER APPLY ( - SELECT a_Color."Name" AS "ColorName", t2.COUNT_1 AS "Count", CASE - WHEN a_Color."Name" = 'Red' THEN t2.COUNT_1 + SELECT a_Color."Name" AS "ColorName", t2."Count_1" AS "Count", CASE + WHEN a_Color."Name" = 'Red' THEN t2."Count_1" ELSE 0 END AS "Conditional" FROM sys.dual UNION ALL diff --git a/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.19.Managed).sql index ce7d4a20b929..335b011b0fb0 100644 --- a/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(Oracle.19.Managed).sql @@ -20,7 +20,7 @@ FROM ( SELECT a_Color."Name" AS "ColorName", a_Style."Name" AS "StyleName", ( SELECT - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) AS "Count" FROM sys.dual diff --git a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed).sql index f08089150c74..b5879875e8d7 100644 --- a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(Oracle.19.Managed).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 0 ) FROM "Parent" p diff --git a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed).sql index 8e56621a044c..768b9ad2c902 100644 --- a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(Oracle.19.Managed).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > 1 ) FROM "Parent" p diff --git a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed).sql index 9c272e23d861..8c835a2a277b 100644 --- a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(Oracle.19.Managed).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed).sql index 7ad82bcb4586..2d29a00bdae2 100644 --- a/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(Oracle.19.Managed).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" a_Children WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = a_Children."ParentID" AND a_Children."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed).sql index 52c7b477fc13..d5e64578a592 100644 --- a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(Oracle.19.Managed).sql @@ -2,97 +2,41 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t7."Key_1", - t7.COUNT_1, - t7.COUNT_2, - t7.COUNT_3, - t7.COUNT_4, - t1.COUNT_1, - t3.COUNT_1, - t4.COUNT_1, - t7.COUNT_5, - t6.COUNT_1 + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN MOD(t."DataValue", 2) = 0D THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD(t."DataValue", 2) = 0D THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as COUNT_1, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_2, - COUNT(*) as COUNT_3, - COUNT(DISTINCT t."DataValue") as COUNT_4, - COUNT(CASE - WHEN MOD(t."DataValue", 2) = 0D THEN 1 - ELSE NULL - END) as COUNT_5 - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t7 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t7."Key_1" = x."GroupId" - ) x_1 - WHERE - MOD(x_1."DataValue", 2) = 0D - ) t1 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t7."Key_1" = t_1."GroupId" AND - MOD(t_1."DataValue", 2) = 0D - ) t2 - ) t3 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t7."Key_1" = x_2."GroupId" AND - MOD(x_2."DataValue", 2) = 0D - ) x_3 - WHERE - MOD(x_3."DataValue", 2) = 0D - ) t4 - OUTER APPLY ( - SELECT - COUNT(*) as COUNT_1 - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t7."Key_1" = t_2."GroupId" AND - MOD(t_2."DataValue", 2) = 0D - ) t5 - ) t6 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 diff --git a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed).sql index db8091c151b5..dd502c3b4a67 100644 --- a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(Oracle.19.Managed).sql @@ -7,7 +7,7 @@ FROM ( SELECT a_Parent."ParentID", - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", a_Parent."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM a_Parent."Value1" ) g_2 WHERE - g_2.COUNT_1 > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed).sql index 2c07da1810a4..27c5c73c52cf 100644 --- a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(Oracle.19.Managed).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN t."Status" = 3 THEN 1 ELSE NULL - END) as COUNT_1 + END) as "Count_1" FROM "Issue1192Table" t WHERE diff --git a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed).sql index c9a783cf4082..77fa94bfa719 100644 --- a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(Oracle.19.Managed).sql @@ -2,23 +2,23 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - g_2.MIN_2 + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1, + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_2 + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2.MIN_1 IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed).sql index 6a35364199ea..b1dcfca61c26 100644 --- a/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(Oracle.19.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - g_2.MIN_1 + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as MIN_1 + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed).sql index 364f8a33cee5..0bcdcd8084fe 100644 --- a/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(Oracle.19.Managed).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed).sql index 8d09bf39999f..2dc223297b22 100644 --- a/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(Oracle.19.Managed).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as "cond_1", trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1.MAX_1, t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as MAX_1 + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed).sql index 3fbb6e657804..4570ab7020c2 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(Oracle.19.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed).sql index a92723217d89..2ee75f493b98 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(Oracle.19.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed).sql index 27539207a54f..561f9a9f4c68 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(Oracle.19.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,1).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,1).sql index 4c6501d2e695..20a435932dd6 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,1).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,2).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,2).sql index 4c6501d2e695..20a435932dd6 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,2).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT - ROUND(p."MoneyValue", 1) as "c1", - p."MoneyValue" + ROUND(p."MoneyValue", 1) as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,1).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,1).sql index a92723217d89..2ee75f493b98 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,1).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,1).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,2).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,2).sql index a92723217d89..2ee75f493b98 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,2).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(Oracle.19.Managed,ToEven,2).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed).sql index f1a12b444b89..f7626dd202a3 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(Oracle.19.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed).sql index a92723217d89..2ee75f493b98 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(Oracle.19.Managed).sql @@ -2,7 +2,7 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as "c1", - p."MoneyValue" + END as "c1" FROM "LinqDataTypes" p ) t diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed).sql index 27539207a54f..561f9a9f4c68 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(Oracle.19.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) * 2 = ROUND(CAST(p."MoneyValue" AS Float) * 2, 1) AND CAST(p."MoneyValue" AS Float) <> ROUND(CAST(p."MoneyValue" AS Float), 1) + THEN ROUND(CAST(p."MoneyValue" AS Float) / 2, 1) * 2 + ELSE ROUND(CAST(p."MoneyValue" AS Float), 1) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) * 2 = ROUND(CAST(t."MoneyValue" AS Float) * 2, 1) AND CAST(t."MoneyValue" AS Float) <> ROUND(CAST(t."MoneyValue" AS Float), 1) - THEN ROUND(CAST(t."MoneyValue" AS Float) / 2, 1) * 2 - ELSE ROUND(CAST(t."MoneyValue" AS Float), 1) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed).sql index e8a06eaf845f..3c7ef17c088e 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(Oracle.19.Managed).sql @@ -2,9 +2,14 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue") as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed).sql index 3cd7148c8b2c..efe3c6d3b5d5 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(Oracle.19.Managed).sql @@ -2,9 +2,14 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(CAST(p."MoneyValue" AS Float)) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(CAST(t."MoneyValue" AS Float)) <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed).sql index 3fbb6e657804..4570ab7020c2 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(Oracle.19.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5D AND MOD(FLOOR(p."MoneyValue"), 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5D AND MOD(FLOOR(t."MoneyValue"), 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed).sql index f1a12b444b89..f7626dd202a3 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(Oracle.19.Managed).sql @@ -2,13 +2,18 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN CAST(p."MoneyValue" AS Float) - FLOOR(CAST(p."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(p."MoneyValue" AS Float)), 2) = 0 + THEN FLOOR(CAST(p."MoneyValue" AS Float)) + ELSE ROUND(CAST(p."MoneyValue" AS Float), 0) + END as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN CAST(t."MoneyValue" AS Float) - FLOOR(CAST(t."MoneyValue" AS Float)) = 0.5D AND MOD(FLOOR(CAST(t."MoneyValue" AS Float)), 2) = 0 - THEN FLOOR(CAST(t."MoneyValue" AS Float)) - ELSE ROUND(CAST(t."MoneyValue" AS Float), 0) - END <> 0D + t."c1" <> 0D diff --git a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed).sql index 1e391b8cad46..f85500470f42 100644 --- a/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(Oracle.19.Managed).sql @@ -2,9 +2,14 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - t."MoneyValue" + t."c1" FROM - "LinqDataTypes" t + ( + SELECT + ROUND(p."MoneyValue", 1) as "c1" + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t."c1" <> 0 diff --git a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed).sql index 93e481b9b4cc..da1e0886c038 100644 --- a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(Oracle.19.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed).sql index 93e481b9b4cc..da1e0886c038 100644 --- a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(Oracle.19.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed).sql index 218bbfd2297c..b91a4c06bd18 100644 --- a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(Oracle.19.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed).sql index 218bbfd2297c..b91a4c06bd18 100644 --- a/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(Oracle.19.Managed).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- Oracle.19.Managed Oracle.Managed Oracle12 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/Oracle.19.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed).sql index 5d1931d04e6f..4cc8269a88ca 100644 --- a/Oracle.19.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(Oracle.19.Managed).sql @@ -4,9 +4,9 @@ DECLARE @take Int32 SET @take = 1 SELECT - COUNT(*) as COUNT_1, + COUNT(*) as "Count_1", 1 + MIN(g_1."ChildID") as "c1", - MAX(g_1."ChildID") as MAX_1 + MAX(g_1."ChildID") as "Max_1" FROM "Child" g_1 FETCH NEXT :take ROWS ONLY diff --git a/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed).sql index f189864cf7b5..40ccbd81b47c 100644 --- a/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(Oracle.19.Managed).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed).sql index d05fae2a250f..946ee727f118 100644 --- a/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(Oracle.19.Managed).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID" as "id", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed).sql index f189864cf7b5..40ccbd81b47c 100644 --- a/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(Oracle.19.Managed).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT a_Patient."Diagnosis", a_Patient."PersonID", - AVG(auto16031."PersonID") as AVG_1 + AVG(auto16031."PersonID") as "Average" FROM "Person" auto16031 LEFT JOIN "Patient" a_Patient ON auto16031."PersonID" = a_Patient."PersonID" diff --git a/Oracle.19.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed).sql index 666cd065088c..48f38f48f85a 100644 --- a/Oracle.19.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(Oracle.19.Managed).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x.MAX_1 + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as MAX_1 + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.19.Managed).sql new file mode 100644 index 000000000000..fd9c369e081b --- /dev/null +++ b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(Oracle.19.Managed).sql @@ -0,0 +1,53 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + ( + SELECT + Coalesce(LISTAGG(t4."item", ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t4 + ), + t3."Join_1" +FROM + "SampleClass" t + OUTER APPLY ( + SELECT + LISTAGG(Coalesce(t2."item_1", ''), ', ') WITHIN GROUP (ORDER BY t2."item_1") as "Join_1" + FROM + ( + SELECT DISTINCT + t1."item" as "item_1" + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + WHERE + t1."item" IS NOT NULL + ) t2 + ) t3 + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.19.Managed).sql new file mode 100644 index 000000000000..2a17221bd640 --- /dev/null +++ b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(Oracle.19.Managed).sql @@ -0,0 +1,43 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + x."Join_1" +FROM + ( + SELECT + ( + SELECT + Coalesce(LISTAGG(CASE + WHEN t1."item" LIKE '%A%' ESCAPE '~' THEN t1."item" + ELSE NULL + END, ', '), '') + FROM + ( + SELECT t."NullableValue" AS "item" FROM sys.dual + UNION ALL + SELECT t."NotNullableValue" FROM sys.dual + UNION ALL + SELECT t."VarcharValue" FROM sys.dual + UNION ALL + SELECT t."NVarcharValue" FROM sys.dual) t1 + ) as "Join_1" + FROM + "SampleClass" t + ) x +WHERE + NOT (x."Join_1" IS NULL OR LTRIM(x."Join_1", ' + …             

  ') IS NULL) + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.19.Managed).sql new file mode 100644 index 000000000000..c5e15129a528 --- /dev/null +++ b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFiltered(Oracle.19.Managed).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.19.Managed).sql new file mode 100644 index 000000000000..aa33019c3496 --- /dev/null +++ b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(Oracle.19.Managed).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 (asynchronously) + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.19.Managed).sql new file mode 100644 index 000000000000..c5e15129a528 --- /dev/null +++ b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(Oracle.19.Managed).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + Coalesce(LISTAGG(t1."NullableValue", ', ') WITHIN GROUP (ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.19.Managed).sql new file mode 100644 index 000000000000..07f93b8b7d79 --- /dev/null +++ b/Oracle.19.Managed/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(Oracle.19.Managed).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + g_1."Id", + LISTAGG(Coalesce(g_1."NullableValue", ''), ', '), + LISTAGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- Oracle.19.Managed Oracle.Managed Oracle12 + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed).sql index d35047af0c63..3415ae98baa6 100644 --- a/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(Oracle.19.Managed).sql @@ -9,30 +9,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute DisposeTransaction diff --git a/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed).sql index 2854f510846b..504cd169c325 100644 --- a/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(Oracle.19.Managed).sql @@ -9,30 +9,25 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + a_Lines."Currency" FROM - "TransactionEntity" x + "LineEntity" a_Lines WHERE - EXISTS( - SELECT - a_Lines."Currency" - FROM - "LineEntity" a_Lines - WHERE - x."Id" = a_Lines."TransactionId" - INTERSECT - SELECT - t1."item" - FROM - ( - SELECT 'A' AS "item" FROM sys.dual - UNION ALL - SELECT 'B' FROM sys.dual) t1 - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = a_Lines."TransactionId" + INTERSECT + SELECT + t1."item" + FROM + ( + SELECT 'A' AS "item" FROM sys.dual + UNION ALL + SELECT 'B' FROM sys.dual) t1 + ) BeforeExecute DisposeTransaction diff --git a/Oracle.19.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed).sql index f9aa78e4fa09..a5b9ea7100fd 100644 --- a/Oracle.19.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(Oracle.19.Managed).sql @@ -2,12 +2,12 @@ -- Oracle.19.Managed Oracle.Managed Oracle12 SELECT - g_1.COUNT_1 + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as COUNT_1 + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1.COUNT_1 > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/Oracle.19.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/Oracle.19.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index d6d3ac19a548..347731337baa 100644 --- a/Oracle.19.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/Oracle.19.Managed/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(Oracle.19.Managed,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1.ID, - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1.ID = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1.ID = d."ParentId" + m_1.ID = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed).sql index 452458339e8d..be10f059e7a3 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(Oracle.19.Managed).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1.SUM_1 + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed).sql index c841cd4a8e7f..e3f752e0d012 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(Oracle.19.Managed).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x.SUM_1 + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" a_Children_1 WHERE o."ParentID" = a_Children_1."ParentID" - ) as SUM_1 + ) as "Sum_1" FROM "Parent" o ) x diff --git a/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed).sql index 35481d003fd1..6d36fa89aa64 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(Oracle.19.Managed).sql @@ -9,5 +9,5 @@ FROM GROUP BY t1."ParentID" HAVING - SUM(t1."ParentID") <> 36 + SUM(t1."ParentID") <> 36 OR SUM(t1."ParentID") IS NULL diff --git a/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.19.Managed).sql index 35481d003fd1..6d36fa89aa64 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(Oracle.19.Managed).sql @@ -9,5 +9,5 @@ FROM GROUP BY t1."ParentID" HAVING - SUM(t1."ParentID") <> 36 + SUM(t1."ParentID") <> 36 OR SUM(t1."ParentID") IS NULL diff --git a/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed).sql index a6f1ba7d5246..c93dc84a0ec2 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(Oracle.19.Managed).sql @@ -9,5 +9,5 @@ FROM GROUP BY g_1."ParentID" HAVING - SUM(g_1."ParentID") <> 36 + SUM(g_1."ParentID") <> 36 OR SUM(g_1."ParentID") IS NULL diff --git a/Oracle.19.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.19.Managed).sql index 222d4b4b6f96..1fae68e5e457 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(Oracle.19.Managed).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + a_Parent."ParentID" FROM - ( - SELECT - a_Parent."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" a_Parent ON t1."ParentID" = a_Parent."ParentID" - FETCH NEXT 1 ROWS ONLY - ) t2 + "Child" t1 + LEFT JOIN "Parent" a_Parent ON t1."ParentID" = a_Parent."ParentID" + FETCH NEXT 1 ROWS ONLY ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/Oracle.19.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed).sql index ec4c9cb5f6fe..ac8447fc1de3 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(Oracle.19.Managed).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(CAST(pcc."PeriodOrderLimit" AS Int),0) as "MaxCapacity", - COALESCE(COALESCE(vsp.SUM_1,0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as SUM_1 + SUM(CAST(COALESCE(oi."Quantity",0) AS Int)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/Oracle.19.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed).sql index fa539f61231d..9733e0ad99d7 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(Oracle.19.Managed).sql @@ -3,7 +3,7 @@ SELECT ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)), - t1.SUM_1, + t1."SubSum", CASE WHEN EXISTS( SELECT @@ -38,12 +38,12 @@ FROM LEFT JOIN "Parent" a_Parent ON c_1."ParentID" = a_Parent."ParentID" WHERE a_Parent."ParentID" = f."ParentID" AND (a_Parent."Value1" = f."Value1" OR a_Parent."Value1" IS NULL AND f."Value1" IS NULL) - ) as SUM_1, + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || CAST(Coalesce(t1."Value1", 0) AS VarChar(255)) LIKE '%1%' ESCAPE '~' AND - t1.SUM_1 > 0 + t1."SubSum" > 0 diff --git a/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed).sql index 1e49f2476ab8..a8c36b0cd4c3 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(Oracle.19.Managed).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2.SUM_1 + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed).sql index a0a7d3116497..ad83d8b1db5b 100644 --- a/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(Oracle.19.Managed).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1.SUM_1, + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as SUM_1 + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/Oracle.19.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed).sql index f140bd79ccae..56e173884c13 100644 --- a/Oracle.19.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(Oracle.19.Managed).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as MAX_1 + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1.MAX_1 OR x."LanguageID" IS NULL AND t1.MAX_1 IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed).sql index 18fb9317919f..e6be0a5246cf 100644 --- a/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(Oracle.19.Managed).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed).sql b/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed).sql index 18fb9317919f..e6be0a5246cf 100644 --- a/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed).sql +++ b/Oracle.19.Managed/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(Oracle.19.Managed).sql @@ -13,9 +13,9 @@ SET WHERE b_1."ChildID" = ( SELECT - MAX(b2_1."ParentID") + MAX(t2."ParentID") FROM - "Child" b2_1 + "Child" t2 ) AND b_1."ChildID" = -1 AND "Parent"."ParentID" = w_1."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = w."ParentID" AND diff --git a/PostgreSQL.13.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql b/PostgreSQL.13.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql index 1c5775a1156f..c28211378e27 100644 --- a/PostgreSQL.13.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql +++ b/PostgreSQL.13.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.13.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql b/PostgreSQL.13.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql index 1c5775a1156f..c28211378e27 100644 --- a/PostgreSQL.13.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql +++ b/PostgreSQL.13.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.13.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..1027c0b64a18 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.13.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.13.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..29e6a9582697 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.13.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.13.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13.LinqService).sql index 40184159556b..82dc4cf09349 100644 --- a/PostgreSQL.13.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13.LinqService).sql index 1437774575ff..5123c6b51c0e 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.13.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13.LinqService,False).sql b/PostgreSQL.13.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13.LinqService,False).sql index 849723fbfd47..a81ac2ca514b 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13.LinqService,False).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13.LinqService,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.13.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13.LinqService).sql index fb14742d084e..b3605fb3e42f 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13.LinqService).sql index 06fe19381606..e3ad5e84bcda 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13.LinqService).sql index 51fa62613789..0f69a42fc1f0 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13.LinqService).sql index b10ac277a5fe..c7e8e5b16f5f 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13.LinqService).sql index ebc4278907fa..edf0bceaf66a 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13.LinqService).sql index ebc4278907fa..edf0bceaf66a 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13.LinqService).sql index 1948c3a2a1f9..55c766ea6792 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13.LinqService).sql index 73bd2ab9c4a5..8bdaad4a8210 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13.LinqService).sql index 3c302d592754..7d96e97bba92 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13.LinqService).sql index c2efa7fcb1fe..b67c84bc1f4d 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13.LinqService).sql index a02517e118a5..f068b0c877e0 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13.LinqService).sql index a02517e118a5..f068b0c877e0 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.13.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..c001252b9a80 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13.LinqService).sql index 636a0bb8fc2b..877470b6e57e 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13.LinqService).sql index f41e068b6400..39746dbcbf26 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13.LinqService).sql index 80309c054ec3..c63678e0a13e 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13.LinqService).sql index a50c0b087b68..285abf5c0d19 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13.LinqService).sql index 2f23d2cb4f05..008517febc6e 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13.LinqService).sql index 634deca34763..0f79ce155394 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13.LinqService).sql @@ -2,93 +2,41 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13.LinqService).sql index 2b2bca1b93a0..544742905e84 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13.LinqService).sql index af55d1866539..4146b72b48c9 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13.LinqService).sql @@ -2,23 +2,23 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13.LinqService).sql index bace69b45497..04e533c96790 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13.LinqService).sql index 4e7099a1d51f..3d35885863f7 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13.LinqService).sql index a6ef3764b562..486c896d71e5 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13.LinqService).sql index 4ffebc648b26..3e4db9f70bf5 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13.LinqService).sql index 117feb9507f1..ec107226474d 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13.LinqService).sql index c664ee620e95..b7c5be575088 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,1).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,1).sql index 4b0744b9b0de..ed915307eef8 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,1).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,2).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,2).sql index 4b0744b9b0de..ed915307eef8 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,2).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,1).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,1).sql index 117feb9507f1..ec107226474d 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,1).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,2).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,2).sql index 117feb9507f1..ec107226474d 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,2).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13.LinqService).sql index 719873444eff..12f21d960376 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13.LinqService).sql index 117feb9507f1..ec107226474d 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13.LinqService).sql index c664ee620e95..b7c5be575088 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13.LinqService).sql index e11950bde630..5d8e3ae84aa8 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13.LinqService).sql index 981657ce8032..ac7d7ce7c837 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13.LinqService).sql index 4ffebc648b26..3e4db9f70bf5 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13.LinqService).sql index 719873444eff..12f21d960376 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13.LinqService).sql index 6315d54fd350..b4a3d2ab0dcc 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13.LinqService).sql index 626b3206b0b2..7ffca45967a3 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13.LinqService).sql index 626b3206b0b2..7ffca45967a3 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13.LinqService).sql index f6aacf738033..cb2d85b4bf60 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13.LinqService).sql index f6aacf738033..cb2d85b4bf60 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.13.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13.LinqService).sql index 5bc2bcaa9097..6be0497ebfb6 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..4409288d34b8 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.13.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value2", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value3", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value3") +FROM + "SampleClass" t +ORDER BY + t."Id" + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..412e3f1bbeea --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.13.LinqService).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..41638c75fcb0 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.13.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..cc7857468b77 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.13.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..1f5392e140a1 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.13.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..240f5a3b47de --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.13.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..240f5a3b47de --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.13.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..35bc63dc54dc --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.13.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..c5a12445d249 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.13.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..3ad14e456648 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.13.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..acb24310a00f --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.13.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..1da4086a40ec --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.13.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.13.LinqService).sql new file mode 100644 index 000000000000..23f723d3a165 --- /dev/null +++ b/PostgreSQL.13.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.13.LinqService).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13.LinqService).sql index 915ccbd415aa..d89c1fec89c7 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13.LinqService).sql index 9ded10c8d7b6..bae9b758b3e1 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.13.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13.LinqService).sql index 9e98afab9e21..3420cbdfe92a 100644 --- a/PostgreSQL.13.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13.LinqService).sql @@ -2,12 +2,12 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.13.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.13.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index cb3e557fedae..57fc7485bb9d 100644 --- a/PostgreSQL.13.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.13.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13.LinqService).sql index fc1b2a07a1de..27033da8dd47 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13.LinqService).sql index c5d52eb2f2c4..a67e11d8aaa8 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13.LinqService).sql index 4d91e5848952..2c00eba06e57 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13.LinqService).sql index ef7635a0bdcc..e3903742c083 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13.LinqService).sql index e70c1df6747a..c72f6467bd4b 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13.LinqService).sql index 834f80be62c3..ca54959268d2 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.13.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13.LinqService).sql index 833204fbeca3..6eed8257b281 100644 --- a/PostgreSQL.13.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13.LinqService).sql index 1d8f426489ad..5bfbfb7085dc 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13.LinqService).sql b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13.LinqService).sql index 1d8f426489ad..5bfbfb7085dc 100644 --- a/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13.LinqService).sql +++ b/PostgreSQL.13.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.13/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.13).sql b/PostgreSQL.13/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.13).sql index 4359a82e04bb..3fba6dfe63e1 100644 --- a/PostgreSQL.13/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.13).sql @@ -96,6 +96,12 @@ WHERE t1."IntValue" > ANY(t2."IntArray") OR t1."IntValue" >= ANY(t2."IntArray") OR t1."IntValue" <> ANY(t2."IntArray") OR + t1."IntValue" = ANY(t2."IntArray") OR + t1."IntValue" < ANY(t2."IntArray") OR + t1."IntValue" <= ANY(t2."IntArray") OR + t1."IntValue" > ANY(t2."IntArray") OR + t1."IntValue" >= ANY(t2."IntArray") OR + t1."IntValue" <> ANY(t2."IntArray") OR t1."IntValue" = ANY(:arr) OR t1."IntValue" < ANY(:arr) OR t1."IntValue" <= ANY(:arr) OR diff --git a/PostgreSQL.13/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.13).sql new file mode 100644 index 000000000000..5051e2c5409f --- /dev/null +++ b/PostgreSQL.13/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.13).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.13/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.13).sql new file mode 100644 index 000000000000..e3bf5eb3f1bb --- /dev/null +++ b/PostgreSQL.13/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.13).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.13/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13).sql index 416a1d1a64fb..e8a208010389 100644 --- a/PostgreSQL.13/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.13).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.13/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13).sql index 8d89fc740b06..b7e4363476e3 100644 --- a/PostgreSQL.13/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.13).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.13/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13,False).sql b/PostgreSQL.13/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13,False).sql index 292388629ea6..59c14669aaa4 100644 --- a/PostgreSQL.13/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13,False).sql +++ b/PostgreSQL.13/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.13,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.13/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13).sql index 4d2a28fcf930..5bbf0e901d7b 100644 --- a/PostgreSQL.13/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.13).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13).sql index 1bb9c61dfcbe..96190080c05a 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.13).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13).sql index 1b5e0ddd5a6e..6eecf63fed2a 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.13).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13).sql index 84109c79a2d1..e085f8c57b0d 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.13).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13).sql index b49e3878451a..e2af279d71e1 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.13).sql @@ -2,22 +2,22 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13).sql index b49e3878451a..e2af279d71e1 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.13).sql @@ -2,22 +2,22 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13).sql index 62bb7a87732d..1354007976dc 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.13).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13).sql index ed50bacca4d8..5bc3993a1792 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.13).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13).sql index 0bfbec718964..20aabdd98b02 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.13).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13).sql index 9b310966588e..885b652f94ff 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.13).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13).sql index 0ee69b2978b0..e152e558414c 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.13).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13).sql index 0ee69b2978b0..e152e558414c 100644 --- a/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.13).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.13/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13).sql new file mode 100644 index 000000000000..55f6fd9f453f --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.13).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.13/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13).sql index f0c876fa15df..4012acd5b4ad 100644 --- a/PostgreSQL.13/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.13).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.13).sql index a96ce05f4a78..96053cb439fb 100644 --- a/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.13).sql @@ -2,7 +2,6 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" "a_Style" ON t3."StyleId" = "a_Style"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - ("a_Color"."Name",t2."COUNT_1",0,"a_Style"."Name",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1","a_Style"."Name",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,"a_Style"."Name",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,"a_Style"."Name",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" "a_Color" ON t3."ColorId" = "a_Color"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 LEFT JOIN LATERAL (VALUES - ("a_Color"."Name",t2."COUNT_1",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END), (NULL,0,NULL) diff --git a/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.13).sql index fdd0b6406c11..0985784ad791 100644 --- a/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.13).sql @@ -2,7 +2,6 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -35,21 +34,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - (t1."ColorName",t1."Count_1",0,t1."StyleName",CASE + (t1."ColorName",t1."Count_1",t1."StyleName",CASE WHEN t1."ColorName" = 'Red' THEN t1."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,t1."StyleName",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,t1."StyleName",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 diff --git a/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.13).sql index 1ca94475f1e6..c4c26779d532 100644 --- a/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.13).sql @@ -20,7 +20,7 @@ FROM (VALUES ("a_Color"."Name","a_Style"."Name",( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 )), diff --git a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13).sql index a1aa4d152cea..47607ecebc76 100644 --- a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.13).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13).sql index 278695bde327..5ba908fa12c6 100644 --- a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.13).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13).sql index a986bdc6fdfe..f84592725b43 100644 --- a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.13).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13).sql index 70c460cef7d5..035a6b1380ba 100644 --- a/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.13).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13).sql index 729d803e38d2..5e8aa83cf56b 100644 --- a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.13).sql @@ -2,93 +2,41 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13).sql index 646728ff91dc..60d95f24e746 100644 --- a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.13).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13).sql index 60d3bca31923..0711629c5dde 100644 --- a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.13).sql @@ -2,23 +2,23 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13).sql index 05ab6c5cc55b..256a6366ea2e 100644 --- a/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.13).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13).sql index 1088f513cdfa..eb8a46bd3544 100644 --- a/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.13).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13).sql index f9fc8d7506c2..97db1ddb3c77 100644 --- a/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.13).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13).sql index 0ef3ebc89907..37847dbbb9a3 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.13).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13).sql index c3eaf64cd0b5..5215716c6c78 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.13).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13).sql index 7156f4e41e80..a09b919902c0 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.13).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,1).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,1).sql index 64cb24bcee0c..309fa3150909 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,1).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,2).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,2).sql index 64cb24bcee0c..309fa3150909 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,2).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,1).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,1).sql index c3eaf64cd0b5..5215716c6c78 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,1).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,2).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,2).sql index c3eaf64cd0b5..5215716c6c78 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,2).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.13,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13).sql index 4787190faf2f..129d91138ce1 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.13).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13).sql index c3eaf64cd0b5..5215716c6c78 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.13).sql @@ -2,7 +2,7 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13).sql index 7156f4e41e80..a09b919902c0 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.13).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13).sql index fbee441731f9..60377954a531 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.13).sql @@ -2,9 +2,17 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13).sql index 83394e88f8a9..a9ae3ef9fa22 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.13).sql @@ -2,9 +2,17 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13).sql index 0ef3ebc89907..37847dbbb9a3 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.13).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13).sql index 4787190faf2f..129d91138ce1 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.13).sql @@ -2,13 +2,18 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13).sql index 2f2dd3279308..340f3cc22a2b 100644 --- a/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.13).sql @@ -2,9 +2,17 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13).sql index aade06dee842..3da04dd75961 100644 --- a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.13).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13).sql index aade06dee842..3da04dd75961 100644 --- a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.13).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13).sql index 6722778fa827..6051209af002 100644 --- a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.13).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13).sql index 6722778fa827..6051209af002 100644 --- a/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.13).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.13/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13).sql index b4d64bd2aa09..7ae046f0fbf3 100644 --- a/PostgreSQL.13/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.13).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.13/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.13).sql index 27f56d73f197..8a74eb021654 100644 --- a/PostgreSQL.13/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.13).sql @@ -2,17 +2,21 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value2") + Coalesce(t."Value2", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value3") + Coalesce(t."Value3", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value3") FROM "SampleClass" t +ORDER BY + t."Id" diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.13).sql new file mode 100644 index 000000000000..b055f888a9a0 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.13).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.13).sql new file mode 100644 index 000000000000..7e704badb870 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.13).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.13).sql new file mode 100644 index 000000000000..f25d27a16cfa --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.13).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.13).sql new file mode 100644 index 000000000000..2b4f7883c21c --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.13).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.13).sql new file mode 100644 index 000000000000..240f5a3b47de --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.13).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.13).sql new file mode 100644 index 000000000000..054a3ff80a5e --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.13).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.13).sql new file mode 100644 index 000000000000..5c17940fc28b --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.13).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.13).sql new file mode 100644 index 000000000000..6e987fc7fda6 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.13).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.13).sql new file mode 100644 index 000000000000..8ed768c26bc7 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.13).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.13).sql new file mode 100644 index 000000000000..3a920b583664 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.13).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.13).sql new file mode 100644 index 000000000000..17ac5878c7e6 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.13).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.13).sql new file mode 100644 index 000000000000..e900e2590c51 --- /dev/null +++ b/PostgreSQL.13/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.13).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13).sql index e72c05f42cde..0bace13109b4 100644 --- a/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.13).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13).sql index b37f292a53b7..1b47def78cc3 100644 --- a/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.13).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.13/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13).sql b/PostgreSQL.13/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13).sql index 548c5f37c1a5..5a989b7e2126 100644 --- a/PostgreSQL.13/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.13).sql @@ -2,12 +2,12 @@ -- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.13/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.13/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index bb61463315c4..a2540413caeb 100644 --- a/PostgreSQL.13/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.13/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.13,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13).sql index e1df359c9e66..9cf12c19527f 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.13).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13).sql index 4377fefeeaa9..3a0d9b5dea65 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.13).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.13).sql index 68ba4a81f3ee..2a8f71750637 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.13).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.13).sql index 68ba4a81f3ee..2a8f71750637 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.13).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.13/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.13).sql index 178085f22b22..06a7ebfaeeea 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.13).sql @@ -59,35 +59,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.13/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13).sql index c9bf5a597500..d4d5044f8e3d 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.13).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.13/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13).sql index 288254b822b4..9c48086ddeb0 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.13).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13).sql index d6a021affbbf..2c2650b300f7 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.13).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13).sql index c9fd7525be1f..7b5e856802b9 100644 --- a/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.13).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.13/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13).sql index e59190c40577..f6a680279fa2 100644 --- a/PostgreSQL.13/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.13).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13).sql index b224f41ecfbb..cb580f9820be 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.13).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13).sql b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13).sql index b224f41ecfbb..cb580f9820be 100644 --- a/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13).sql +++ b/PostgreSQL.13/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.13).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.14.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql b/PostgreSQL.14.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql index 1c5775a1156f..c28211378e27 100644 --- a/PostgreSQL.14.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql +++ b/PostgreSQL.14.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.14.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql b/PostgreSQL.14.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql index 1c5775a1156f..c28211378e27 100644 --- a/PostgreSQL.14.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql +++ b/PostgreSQL.14.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.14.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..728fedb5d563 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.14.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.14.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..4ad812742c78 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.14.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.14.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14.LinqService).sql index 3a870bacc513..af75992e47fb 100644 --- a/PostgreSQL.14.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14.LinqService).sql index e761c04b3419..62c5a22143ba 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.14.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14.LinqService,False).sql b/PostgreSQL.14.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14.LinqService,False).sql index 489d72fd593d..343604c91237 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14.LinqService,False).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14.LinqService,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.14.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14.LinqService).sql index 20343f6dcc89..5035fb8415c7 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14.LinqService).sql index f16a85a00259..220de6cde271 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14.LinqService).sql index 9a4af0294c5e..9a917b656060 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14.LinqService).sql index efca363f7962..5a5ffa576aff 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14.LinqService).sql index c61d569903e2..bb098eca5ecd 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14.LinqService).sql index c61d569903e2..bb098eca5ecd 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14.LinqService).sql index e72f1140f67f..3db6c6ed62e5 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14.LinqService).sql index 97d30f72426d..6fb68b6fe170 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14.LinqService).sql index 4cdcf1e7c530..871e91061ba0 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14.LinqService).sql index 8ecbf28e1118..fa07a5d8b3e8 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14.LinqService).sql index 4f936ed6994e..c9fb07597128 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14.LinqService).sql index 4f936ed6994e..c9fb07597128 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.14.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..e7553078be61 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14.LinqService).sql index 68d15b5a6813..44f48a1985fe 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14.LinqService).sql index 2e6b16d41e0d..210e82e1e0fd 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14.LinqService).sql index 59fa9e5fa09c..c951565101fa 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14.LinqService).sql index 2c94045102b4..23ce636c81bf 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14.LinqService).sql index 923c909fcfe8..6bb04f948064 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14.LinqService).sql index a2ad20a9fd4c..8c57fc51ee5f 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14.LinqService).sql @@ -2,93 +2,41 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14.LinqService).sql index acca9466cc87..43dda8be0a51 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14.LinqService).sql index c663a8e02d86..f1296b345f2f 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14.LinqService).sql @@ -2,23 +2,23 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14.LinqService).sql index 69896f1ef362..4a7ce44c6ea1 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14.LinqService).sql index 2ac960064e19..77a1029cb845 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14.LinqService).sql index f80bc12ea28c..f8b6101ff5cc 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14.LinqService).sql index d37debfaabe7..689ea3e34724 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14.LinqService).sql index 4de8d0044e4d..57d0afa10caf 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14.LinqService).sql index ae99a259418d..6c281e1b6b0a 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,1).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,1).sql index 47040a8361ae..80fe12fe12d1 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,1).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,2).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,2).sql index 47040a8361ae..80fe12fe12d1 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,2).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,1).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,1).sql index 4de8d0044e4d..57d0afa10caf 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,1).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,2).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,2).sql index 4de8d0044e4d..57d0afa10caf 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,2).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14.LinqService).sql index da85501c4c38..569f6820e3b2 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14.LinqService).sql index 4de8d0044e4d..57d0afa10caf 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14.LinqService).sql index ae99a259418d..6c281e1b6b0a 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14.LinqService).sql index f4e7bf94e353..de7981e73d24 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14.LinqService).sql index ccd2432868fa..ce7fa005122e 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14.LinqService).sql index d37debfaabe7..689ea3e34724 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14.LinqService).sql index da85501c4c38..569f6820e3b2 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14.LinqService).sql index ae04e3c0fb3b..be0e822c4de1 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14.LinqService).sql index a4f792801bdf..5ad767c9d005 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14.LinqService).sql index a4f792801bdf..5ad767c9d005 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14.LinqService).sql index a1301f5045ef..14f926d0f4a1 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14.LinqService).sql index a1301f5045ef..14f926d0f4a1 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.14.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14.LinqService).sql index 69a96d829551..cac15af54338 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..8b581924a576 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.14.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value2", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value3", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value3") +FROM + "SampleClass" t +ORDER BY + t."Id" + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..aea7a089d47b --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.14.LinqService).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..60d2cbd4979b --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.14.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..f6a99fcb7ab5 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.14.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..a9e8e060094c --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.14.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..180145211c02 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.14.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..180145211c02 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.14.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..c4807af539b3 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.14.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..aff6cf547d48 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.14.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..d755aca18b6c --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.14.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..0590b9ef2afb --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.14.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..88eebf67f75c --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.14.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.14.LinqService).sql new file mode 100644 index 000000000000..c882b2311be0 --- /dev/null +++ b/PostgreSQL.14.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.14.LinqService).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14.LinqService).sql index 16f94f4a07c0..c66ebdb57ddd 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14.LinqService).sql index 887f3d18e7b3..2408d0716bb1 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.14.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14.LinqService).sql index b314e6bb602f..157c969a67dc 100644 --- a/PostgreSQL.14.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14.LinqService).sql @@ -2,12 +2,12 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.14.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.14.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index ddd69aee48fe..ed0e871a144a 100644 --- a/PostgreSQL.14.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.14.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14.LinqService).sql index 9a270f606530..325f37945ce2 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14.LinqService).sql index b1d3beeeb260..91c790f40947 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14.LinqService).sql index 850cc229bd39..d617ac0d47da 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14.LinqService).sql index 2e04ffd276ae..fa6c3c05f3a3 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14.LinqService).sql index 74db9571c44a..f49e529f8d9b 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14.LinqService).sql index 699bdbf28608..062f7acec36a 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.14.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14.LinqService).sql index bb3918c83750..e13c7a094bbd 100644 --- a/PostgreSQL.14.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14.LinqService).sql index 1f871a39f9a3..267b07a841a9 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14.LinqService).sql b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14.LinqService).sql index 1f871a39f9a3..267b07a841a9 100644 --- a/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14.LinqService).sql +++ b/PostgreSQL.14.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.14/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.14).sql b/PostgreSQL.14/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.14).sql index c5fb042768e6..0b20bb43d57e 100644 --- a/PostgreSQL.14/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.14).sql @@ -96,6 +96,12 @@ WHERE t1."IntValue" > ANY(t2."IntArray") OR t1."IntValue" >= ANY(t2."IntArray") OR t1."IntValue" <> ANY(t2."IntArray") OR + t1."IntValue" = ANY(t2."IntArray") OR + t1."IntValue" < ANY(t2."IntArray") OR + t1."IntValue" <= ANY(t2."IntArray") OR + t1."IntValue" > ANY(t2."IntArray") OR + t1."IntValue" >= ANY(t2."IntArray") OR + t1."IntValue" <> ANY(t2."IntArray") OR t1."IntValue" = ANY(:arr) OR t1."IntValue" < ANY(:arr) OR t1."IntValue" <= ANY(:arr) OR diff --git a/PostgreSQL.14/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.14).sql new file mode 100644 index 000000000000..ba861c5b905a --- /dev/null +++ b/PostgreSQL.14/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.14).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.14/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.14).sql new file mode 100644 index 000000000000..023b4b06e389 --- /dev/null +++ b/PostgreSQL.14/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.14).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.14/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14).sql index fbd44c0c2107..fa3146f17e93 100644 --- a/PostgreSQL.14/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.14).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.14/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14).sql index 2cbc57008e3f..7e8f14311be8 100644 --- a/PostgreSQL.14/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.14).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.14/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14,False).sql b/PostgreSQL.14/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14,False).sql index 49835044b998..25b2e7370ba5 100644 --- a/PostgreSQL.14/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14,False).sql +++ b/PostgreSQL.14/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.14,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.14/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14).sql index d8b8a59e01fb..465a56b97d05 100644 --- a/PostgreSQL.14/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.14).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14).sql index 9e5cac59948c..68700308a784 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.14).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14).sql index 939956982f7c..fe5cf16552ff 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.14).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14).sql index 6b4cac655c5f..866bdce612dd 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.14).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14).sql index b91bfed20d8e..3626d5f26cc4 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.14).sql @@ -2,22 +2,22 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14).sql index b91bfed20d8e..3626d5f26cc4 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.14).sql @@ -2,22 +2,22 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14).sql index 0fa2467eea9f..4bae28396b0e 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.14).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14).sql index 4aafc9d3ef3e..e0f9900a2756 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.14).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14).sql index 5dbc4a0f37b3..7939d3026f47 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.14).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14).sql index 72da4643c1ab..797731e1eefa 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.14).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14).sql index 0c8dbbf13f7a..c1c913da7cde 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.14).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14).sql index 0c8dbbf13f7a..c1c913da7cde 100644 --- a/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.14).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.14/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14).sql new file mode 100644 index 000000000000..19d2d63e0792 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.14).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.14/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14).sql index 2c84a98d84d0..1c09267e52dd 100644 --- a/PostgreSQL.14/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.14).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.14).sql index eb90c89d88b2..93dc95abcba6 100644 --- a/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.14).sql @@ -2,7 +2,6 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" "a_Style" ON t3."StyleId" = "a_Style"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - ("a_Color"."Name",t2."COUNT_1",0,"a_Style"."Name",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1","a_Style"."Name",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,"a_Style"."Name",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,"a_Style"."Name",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" "a_Color" ON t3."ColorId" = "a_Color"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 LEFT JOIN LATERAL (VALUES - ("a_Color"."Name",t2."COUNT_1",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END), (NULL,0,NULL) diff --git a/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.14).sql index 904aa2f92830..3d10a9378d80 100644 --- a/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.14).sql @@ -2,7 +2,6 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -35,21 +34,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - (t1."ColorName",t1."Count_1",0,t1."StyleName",CASE + (t1."ColorName",t1."Count_1",t1."StyleName",CASE WHEN t1."ColorName" = 'Red' THEN t1."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,t1."StyleName",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,t1."StyleName",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 diff --git a/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.14).sql index 8c33de89a2e0..1dda3075686a 100644 --- a/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.14).sql @@ -20,7 +20,7 @@ FROM (VALUES ("a_Color"."Name","a_Style"."Name",( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 )), diff --git a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14).sql index c838322d31de..999ba8cb2533 100644 --- a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.14).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14).sql index 77d3b8468596..d2c101397386 100644 --- a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.14).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14).sql index 315bf908583e..a6a734a0be82 100644 --- a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.14).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14).sql index e0db26c54f70..1de3f622b6aa 100644 --- a/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.14).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14).sql index be05e36204ae..85d085e33a36 100644 --- a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.14).sql @@ -2,93 +2,41 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL diff --git a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14).sql index 60e54988ded3..813400fd76eb 100644 --- a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.14).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14).sql index 59a66e2c8682..09b18d5995c8 100644 --- a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.14).sql @@ -2,23 +2,23 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14).sql index 4ed405ebd11c..fa9a3df68b90 100644 --- a/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.14).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14).sql index 07e6224db3d0..080ba82a8abd 100644 --- a/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.14).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14).sql index d1d54fd0fc75..cb65eaadad26 100644 --- a/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.14).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14).sql index a8eaa68ba8c9..e1c86144d42e 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.14).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14).sql index 41e6d63ab31b..9fc0c0a7dc30 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.14).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14).sql index e70a37d5e026..51c2b9fed48d 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.14).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,1).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,1).sql index d8a91595fd68..f086b6d861bf 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,1).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,2).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,2).sql index d8a91595fd68..f086b6d861bf 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,2).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,1).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,1).sql index 41e6d63ab31b..9fc0c0a7dc30 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,1).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,2).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,2).sql index 41e6d63ab31b..9fc0c0a7dc30 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,2).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.14,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14).sql index e78637d5bd7d..c56b268635ae 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.14).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14).sql index 41e6d63ab31b..9fc0c0a7dc30 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.14).sql @@ -2,7 +2,7 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14).sql index e70a37d5e026..51c2b9fed48d 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.14).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14).sql index a54c53533441..8493e622335c 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.14).sql @@ -2,9 +2,17 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14).sql index f98e0892862c..0e2815dc9eb2 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.14).sql @@ -2,9 +2,17 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14).sql index a8eaa68ba8c9..e1c86144d42e 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.14).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14).sql index e78637d5bd7d..c56b268635ae 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.14).sql @@ -2,13 +2,18 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14).sql index 534ebf26384e..05e5fdb88bee 100644 --- a/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.14).sql @@ -2,9 +2,17 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14).sql index c35a8dc593ce..e5729d8e54dd 100644 --- a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.14).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14).sql index c35a8dc593ce..e5729d8e54dd 100644 --- a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.14).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14).sql index fc51782fde17..36adcab71b3e 100644 --- a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.14).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14).sql index fc51782fde17..36adcab71b3e 100644 --- a/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.14).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.14/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14).sql index 34319e672827..72791343d233 100644 --- a/PostgreSQL.14/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.14).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.14/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.14).sql index 3b7336827dc9..8a70cce9f80f 100644 --- a/PostgreSQL.14/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.14).sql @@ -2,17 +2,21 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value2") + Coalesce(t."Value2", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value3") + Coalesce(t."Value3", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value3") FROM "SampleClass" t +ORDER BY + t."Id" diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.14).sql new file mode 100644 index 000000000000..771580293781 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.14).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.14).sql new file mode 100644 index 000000000000..68b139b1d4c5 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.14).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.14).sql new file mode 100644 index 000000000000..080911be5ba8 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.14).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.14).sql new file mode 100644 index 000000000000..0822e408d109 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.14).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.14).sql new file mode 100644 index 000000000000..180145211c02 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.14).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.14).sql new file mode 100644 index 000000000000..ca33c18dcd92 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.14).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.14).sql new file mode 100644 index 000000000000..ee408a83d4db --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.14).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.14).sql new file mode 100644 index 000000000000..9cfaa08aba10 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.14).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.14).sql new file mode 100644 index 000000000000..8d7414454403 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.14).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.14).sql new file mode 100644 index 000000000000..1ffc27cbf75f --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.14).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.14).sql new file mode 100644 index 000000000000..bbf8dcbebad8 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.14).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.14).sql new file mode 100644 index 000000000000..0965d212f4d9 --- /dev/null +++ b/PostgreSQL.14/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.14).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14).sql index 827cd3b85b57..bbb1988efdea 100644 --- a/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.14).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14).sql index 09df6fcef444..238c6f173afc 100644 --- a/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.14).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.14/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14).sql b/PostgreSQL.14/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14).sql index 8d3ecd0b1652..9574356b5b56 100644 --- a/PostgreSQL.14/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.14).sql @@ -2,12 +2,12 @@ -- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.14/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.14/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 626a63d68bf4..14af247e41b3 100644 --- a/PostgreSQL.14/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.14/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.14,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14).sql index 89049794ba25..d8f3673e5650 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.14).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14).sql index 3ac832d1c5bb..318042d26497 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.14).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.14).sql index 68ba4a81f3ee..2a8f71750637 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.14).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.14).sql index 68ba4a81f3ee..2a8f71750637 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.14).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.14/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.14).sql index dc3a699ec70a..942d7fea8530 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.14).sql @@ -59,35 +59,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.14/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14).sql index 6becb98f4dea..5005312ae0a1 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.14).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.14/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14).sql index 5c83c028cb24..b67751a32168 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.14).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14).sql index 38bf257927e2..59c6766dcba9 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.14).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14).sql index 618a22de4239..124061e91a2a 100644 --- a/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.14).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.14/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14).sql index 5979b246c60f..07d50840dc55 100644 --- a/PostgreSQL.14/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.14).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14).sql index dbc99b1e4339..cda927eefced 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.14).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14).sql b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14).sql index dbc99b1e4339..cda927eefced 100644 --- a/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14).sql +++ b/PostgreSQL.14/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.14).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.15.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql b/PostgreSQL.15.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql index bc43196a3204..93ad99079fd3 100644 --- a/PostgreSQL.15.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql +++ b/PostgreSQL.15.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.15.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql b/PostgreSQL.15.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql index bc43196a3204..93ad99079fd3 100644 --- a/PostgreSQL.15.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql +++ b/PostgreSQL.15.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.15.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..33e026bae7dd --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.15.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.15.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..7f0a42ac02f8 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.15.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.15.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15.LinqService).sql index d91ffedee21a..a476367bcfe0 100644 --- a/PostgreSQL.15.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15.LinqService).sql index 14c6f2384d39..2b4e3d3e07e6 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.15.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15.LinqService,False).sql b/PostgreSQL.15.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15.LinqService,False).sql index 2d8f0b125132..8f199d61edf3 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15.LinqService,False).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15.LinqService,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.15.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15.LinqService).sql index 4bbb0b7d41ae..d8232662faf3 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15.LinqService).sql index 77e13fe08a58..5c970bd110d8 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15.LinqService).sql index ee261f262a49..8e1f75ac7e2c 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15.LinqService).sql index 41d63d257dae..97e704b1ec34 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15.LinqService).sql index af8de2c17aa4..720ed087bcb9 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15.LinqService).sql index af8de2c17aa4..720ed087bcb9 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15.LinqService).sql index 2422b2f00553..ef6ca155ad33 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15.LinqService).sql index dbdcacf9d0ac..08c06fa4fcf5 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15.LinqService).sql index dffb9c110feb..e6a1a2937836 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15.LinqService).sql index 5b0c1fcdd719..95360fc9d066 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15.LinqService).sql index f8f86725383e..029580ed670f 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15.LinqService).sql index f8f86725383e..029580ed670f 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.15.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..1ebe3c660f29 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15.LinqService).sql index 4770b28d0fe9..09251652012f 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15.LinqService).sql index d465ca54621d..d61e51dcd14b 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15.LinqService).sql index 8692d3988ed0..c3ffb270b6da 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15.LinqService).sql index f56a549025d3..d10ac57831b0 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15.LinqService).sql index 34387bc02b98..32149d7fd984 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15.LinqService).sql index 946b7951ad6a..6335f383fe7d 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15.LinqService).sql @@ -2,93 +2,41 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15.LinqService).sql index 8c5e8205f9b4..5f1321fd44ec 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15.LinqService).sql index 77b283e89bd2..88d0defed5dd 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15.LinqService).sql @@ -2,23 +2,23 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15.LinqService).sql index 4597d8566841..7bd5987bc102 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15.LinqService).sql index 3f44c897ba03..3007fa77e4d6 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15.LinqService).sql index 8d126a29d533..65d95fa9dc81 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15.LinqService).sql index 5644c97808b4..31dc49c51132 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15.LinqService).sql index 73832382409f..6be1931db312 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15.LinqService).sql index b7d87ed5f71d..994ad397464e 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,1).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,1).sql index 6693d1f9e31c..948e858c231d 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,1).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,2).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,2).sql index 6693d1f9e31c..948e858c231d 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,2).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,1).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,1).sql index 73832382409f..6be1931db312 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,1).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,2).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,2).sql index 73832382409f..6be1931db312 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,2).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15.LinqService).sql index 39b614f82962..08a8aa328e1a 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15.LinqService).sql index 73832382409f..6be1931db312 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15.LinqService).sql index b7d87ed5f71d..994ad397464e 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15.LinqService).sql index 62bdbbd489da..21637628d8f1 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15.LinqService).sql index 1474524eb7e4..4ddd7a596cb5 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15.LinqService).sql index 5644c97808b4..31dc49c51132 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15.LinqService).sql index 39b614f82962..08a8aa328e1a 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15.LinqService).sql index c9bdca70169c..e1c51a0880ea 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15.LinqService).sql index e12612ca39b3..396c0fdfe428 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15.LinqService).sql index e12612ca39b3..396c0fdfe428 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15.LinqService).sql index bee3a97b1fe4..ecf447d71f91 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15.LinqService).sql index bee3a97b1fe4..ecf447d71f91 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.15.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15.LinqService).sql index 4f58735c60a5..d0c5034a1f22 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..e6c8f91795a4 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.15.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value2", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value3", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value3") +FROM + "SampleClass" t +ORDER BY + t."Id" + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..b356311b8db0 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.15.LinqService).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..a7bc8ca9c9ca --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.15.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..f0253b163dc1 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.15.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..08b32d704eba --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.15.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..634baa9e26ed --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.15.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..634baa9e26ed --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.15.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..10ab7f227ca5 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.15.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..9001cf2b7429 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.15.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..12cbc58aa854 --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.15.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..e904d194bbad --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.15.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..2fbbc73ebb9e --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.15.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.15.LinqService).sql new file mode 100644 index 000000000000..207641f62bbe --- /dev/null +++ b/PostgreSQL.15.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.15.LinqService).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15.LinqService).sql index 52290dba67f8..f9ff195c1b49 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15.LinqService).sql index c721a92ff915..e4b5814ae07b 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.15.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15.LinqService).sql index 73cc8bdb893f..34067f5bcc74 100644 --- a/PostgreSQL.15.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15.LinqService).sql @@ -2,12 +2,12 @@ -- PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.15.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.15.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index d61a483f370e..14124eeb9e63 100644 --- a/PostgreSQL.15.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.15.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15.LinqService).sql index 5409a7695b14..cafad8a0b9c3 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15.LinqService).sql index 60ceedb0d5cf..61019a45f799 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15.LinqService).sql index f22a03387091..12b2d50aa71f 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15.LinqService).sql index 171e8ab012d6..fb06397816ee 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15.LinqService).sql index db6c83a520dd..3a7c6b8764b9 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15.LinqService).sql index 63706290cbd5..1aa8654edb5c 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.15.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15.LinqService).sql index 4cfafb41ac4e..cfb7f8560bf7 100644 --- a/PostgreSQL.15.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15.LinqService).sql index a04272d88010..4e30c3548bcb 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15.LinqService).sql b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15.LinqService).sql index a04272d88010..4e30c3548bcb 100644 --- a/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15.LinqService).sql +++ b/PostgreSQL.15.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.15/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.15).sql b/PostgreSQL.15/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.15).sql index fc6b9928b961..c64d270587b8 100644 --- a/PostgreSQL.15/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.15).sql @@ -96,6 +96,12 @@ WHERE t1."IntValue" > ANY(t2."IntArray") OR t1."IntValue" >= ANY(t2."IntArray") OR t1."IntValue" <> ANY(t2."IntArray") OR + t1."IntValue" = ANY(t2."IntArray") OR + t1."IntValue" < ANY(t2."IntArray") OR + t1."IntValue" <= ANY(t2."IntArray") OR + t1."IntValue" > ANY(t2."IntArray") OR + t1."IntValue" >= ANY(t2."IntArray") OR + t1."IntValue" <> ANY(t2."IntArray") OR t1."IntValue" = ANY(:arr) OR t1."IntValue" < ANY(:arr) OR t1."IntValue" <= ANY(:arr) OR diff --git a/PostgreSQL.15/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.15).sql new file mode 100644 index 000000000000..33f994117947 --- /dev/null +++ b/PostgreSQL.15/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.15).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.15/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.15).sql new file mode 100644 index 000000000000..df0663df6862 --- /dev/null +++ b/PostgreSQL.15/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.15).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.15/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15).sql index 79e788559abb..0e44b4788428 100644 --- a/PostgreSQL.15/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.15).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.15/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15).sql index d7c62a315f6b..453f773b2180 100644 --- a/PostgreSQL.15/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.15).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.15/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15,False).sql b/PostgreSQL.15/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15,False).sql index b1e44812acbd..b32a88c03a8e 100644 --- a/PostgreSQL.15/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15,False).sql +++ b/PostgreSQL.15/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.15,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.15 PostgreSQL DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.15 PostgreSQL DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.15/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15).sql index 62ec60fc515e..63cfbc72df80 100644 --- a/PostgreSQL.15/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.15).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15).sql index e7050aaf461c..a8895075cadf 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.15).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15).sql index 958512bdbd05..49364f5d3d92 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.15).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15).sql index 26baa5f7ff0e..3ad375054f50 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.15).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15).sql index 8f2d2f6acb0b..9f5760420971 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.15).sql @@ -2,22 +2,22 @@ -- PostgreSQL.15 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15).sql index 8f2d2f6acb0b..9f5760420971 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.15).sql @@ -2,22 +2,22 @@ -- PostgreSQL.15 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15).sql index 4f94818b509b..b28c7bac05f7 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.15).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15).sql index 7f57a29499a3..f772f326e8ec 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.15).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15).sql index 1cd4e31c7837..6b0558b7642b 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.15).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15).sql index 390e592ebf7b..47d0cfaef6ac 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.15).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15).sql index d41e03811094..0fc810942249 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.15).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15).sql index d41e03811094..0fc810942249 100644 --- a/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.15).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.15/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15).sql new file mode 100644 index 000000000000..5671ebabb274 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.15).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.15/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15).sql index 1d6bb0eefbe8..23bc5725715e 100644 --- a/PostgreSQL.15/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.15).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.15).sql index d1261db6e3e4..cdce2e4fd6c2 100644 --- a/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.15).sql @@ -2,7 +2,6 @@ -- PostgreSQL.15 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" "a_Style" ON t3."StyleId" = "a_Style"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - ("a_Color"."Name",t2."COUNT_1",0,"a_Style"."Name",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1","a_Style"."Name",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,"a_Style"."Name",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,"a_Style"."Name",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" "a_Color" ON t3."ColorId" = "a_Color"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 LEFT JOIN LATERAL (VALUES - ("a_Color"."Name",t2."COUNT_1",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END), (NULL,0,NULL) diff --git a/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.15).sql index a86510f9a936..28d4cf30f263 100644 --- a/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.15).sql @@ -2,7 +2,6 @@ -- PostgreSQL.15 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -35,21 +34,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - (t1."ColorName",t1."Count_1",0,t1."StyleName",CASE + (t1."ColorName",t1."Count_1",t1."StyleName",CASE WHEN t1."ColorName" = 'Red' THEN t1."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,t1."StyleName",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,t1."StyleName",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 diff --git a/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.15).sql index 6d81fc293777..68cf7f0df75b 100644 --- a/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.15).sql @@ -20,7 +20,7 @@ FROM (VALUES ("a_Color"."Name","a_Style"."Name",( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 )), diff --git a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15).sql index e351b355cd23..25b758348993 100644 --- a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.15).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15).sql index d12e0a4f08f5..357615daca8c 100644 --- a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.15).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15).sql index 013a74194768..7e18e6a8e662 100644 --- a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.15).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15).sql index 5825567bae05..af2bfdd6edf9 100644 --- a/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.15).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15).sql index cd8e9a05153d..08e029923da5 100644 --- a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.15).sql @@ -2,93 +2,41 @@ -- PostgreSQL.15 PostgreSQL SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15).sql index 37f467dd9bb0..c7c2477a540f 100644 --- a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.15).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15).sql index 194149ce6def..98bacdf54731 100644 --- a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.15).sql @@ -2,23 +2,23 @@ -- PostgreSQL.15 PostgreSQL SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15).sql index 10165132a272..4df7621feb39 100644 --- a/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.15).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15).sql index f93dbe87087b..04494dd6c086 100644 --- a/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.15).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15).sql index 0f2bd1607746..1be688bf727c 100644 --- a/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.15).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15).sql index dc858bd305b2..27e78e776224 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.15).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15).sql index 29be5abc6965..cf013c763c07 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.15).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15).sql index d19949bffaea..78735cddb3c1 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.15).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,1).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,1).sql index a40ea900c801..14f86a6d9322 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,1).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,2).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,2).sql index a40ea900c801..14f86a6d9322 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,2).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,1).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,1).sql index 29be5abc6965..cf013c763c07 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,1).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,2).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,2).sql index 29be5abc6965..cf013c763c07 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,2).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.15,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15).sql index 9b1a272bef3c..a775b9aa5ba2 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.15).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15).sql index 29be5abc6965..cf013c763c07 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.15).sql @@ -2,7 +2,7 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15).sql index d19949bffaea..78735cddb3c1 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.15).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15).sql index 35edf2318ab1..15c9758a788d 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.15).sql @@ -2,9 +2,17 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15).sql index d3b9be83c2a8..2e2019011f6c 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.15).sql @@ -2,9 +2,17 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15).sql index dc858bd305b2..27e78e776224 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.15).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15).sql index 9b1a272bef3c..a775b9aa5ba2 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.15).sql @@ -2,13 +2,18 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15).sql index 011ce78c4dc1..23643e442f3a 100644 --- a/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.15).sql @@ -2,9 +2,17 @@ -- PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15).sql index aa86af30208c..2b20dbc6faa8 100644 --- a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.15).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15).sql index aa86af30208c..2b20dbc6faa8 100644 --- a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.15).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15).sql index b1f4ac1106ef..b478eb89fe8d 100644 --- a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.15).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15).sql index b1f4ac1106ef..b478eb89fe8d 100644 --- a/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.15).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.15/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15).sql index a5c21ca89935..de6ac0b60c39 100644 --- a/PostgreSQL.15/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.15).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.15/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.15).sql index e7420d16a2bf..4e0521ff4a54 100644 --- a/PostgreSQL.15/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.15).sql @@ -2,17 +2,21 @@ -- PostgreSQL.15 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value2") + Coalesce(t."Value2", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.15 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value3") + Coalesce(t."Value3", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.15 PostgreSQL @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value3") FROM "SampleClass" t +ORDER BY + t."Id" diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.15).sql new file mode 100644 index 000000000000..76baf9c1a3e6 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.15).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.15).sql new file mode 100644 index 000000000000..ac8e9e026d2f --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.15).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.15).sql new file mode 100644 index 000000000000..6baf29f20901 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.15).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.15).sql new file mode 100644 index 000000000000..6a827dd1e61f --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.15).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.15).sql new file mode 100644 index 000000000000..634baa9e26ed --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.15).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.15).sql new file mode 100644 index 000000000000..597dd1733490 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.15).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.15).sql new file mode 100644 index 000000000000..e91022b8e1a7 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.15).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.15).sql new file mode 100644 index 000000000000..5143c50375e2 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.15).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.15).sql new file mode 100644 index 000000000000..8def5ca35405 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.15).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.15).sql new file mode 100644 index 000000000000..9c0a6d98394a --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.15).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.15).sql new file mode 100644 index 000000000000..bde708abe86d --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.15).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.15).sql new file mode 100644 index 000000000000..31ee10d420b1 --- /dev/null +++ b/PostgreSQL.15/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.15).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15).sql index 2773c5ba642f..4ac752c98a77 100644 --- a/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.15).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15).sql index 80968b793057..d4614612764b 100644 --- a/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.15).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.15/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15).sql b/PostgreSQL.15/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15).sql index 858007801b7e..7631f87a65a9 100644 --- a/PostgreSQL.15/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.15).sql @@ -2,12 +2,12 @@ -- PostgreSQL.15 PostgreSQL SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.15/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.15/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 5a303320b327..b6d9b83222ed 100644 --- a/PostgreSQL.15/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.15/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.15,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15).sql index 364925c5b8be..d9b56400dd84 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.15).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15).sql index eeb07e8c8d05..a842d818b060 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.15).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.15).sql index 3f131c63e82b..55d6d087aae1 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.15).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.15).sql index 3f131c63e82b..55d6d087aae1 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.15).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.15/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.15).sql index 5d5464fe1473..f9caa9781f43 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.15).sql @@ -59,35 +59,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.15/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15).sql index 4de29f8968a3..5af6bf1c0f88 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.15).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.15/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15).sql index 1fd69a9c62c6..4507c6cd0fde 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.15).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15).sql index 07db10fc5b67..b129cf1f33a2 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.15).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15).sql index cae817585c92..5c56265a1be3 100644 --- a/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.15).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.15/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15).sql index 8a2e4b64274a..272849edc198 100644 --- a/PostgreSQL.15/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.15).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15).sql index ba3276c7de3f..4a520213f828 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.15).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15).sql b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15).sql index ba3276c7de3f..4a520213f828 100644 --- a/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15).sql +++ b/PostgreSQL.15/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.15).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql b/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql index de0253d7f486..aec298db582c 100644 --- a/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql +++ b/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."Issue4626AnyValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", ANY_VALUE(d."Name") as "Issue4626AnyValue" FROM "Children" d diff --git a/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql b/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql index bc43196a3204..93ad99079fd3 100644 --- a/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql +++ b/PostgreSQL.16.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql b/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql index de0253d7f486..aec298db582c 100644 --- a/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql +++ b/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."Issue4626AnyValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", ANY_VALUE(d."Name") as "Issue4626AnyValue" FROM "Children" d diff --git a/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql b/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql index bc43196a3204..93ad99079fd3 100644 --- a/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql +++ b/PostgreSQL.16.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.16.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..dd296c6807cd --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.16.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.16.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..e6fa2aa21f16 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.16.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.16.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16.LinqService).sql index 079c5cf3e732..7698c6babd36 100644 --- a/PostgreSQL.16.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16.LinqService).sql index 11393ff08582..1278a461baaf 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.16.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16.LinqService,False).sql b/PostgreSQL.16.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16.LinqService,False).sql index 5c9767282cb0..81ad925957b1 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16.LinqService,False).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16.LinqService,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.16.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16.LinqService).sql index 10e7efe85895..d3bce04b530a 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16.LinqService).sql index 2ee847f37ced..ca671b11d80b 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16.LinqService).sql index 716704098b98..e4d5d7b8b3ed 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16.LinqService).sql index a03fdb01c58a..3c00a45cb0c6 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16.LinqService).sql index a89b36f15cc8..d98d0a635246 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16.LinqService).sql index a89b36f15cc8..d98d0a635246 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16.LinqService).sql index 79bda52b8995..7aefa5259a88 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16.LinqService).sql index ea15c0d0b3c8..f5d25eff4e3c 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16.LinqService).sql index bb28d0fcb99c..1d89d4e1617b 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16.LinqService).sql index ad53e65d813f..1fbedecd32eb 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16.LinqService).sql index 65342e423c6e..d60bea49810e 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16.LinqService).sql index 65342e423c6e..d60bea49810e 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.16.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..48c14956466c --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16.LinqService).sql index d1babba23384..e6c407fbe4c9 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16.LinqService).sql index 0a2fcd7470e2..d16944eea147 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16.LinqService).sql index 0f5ad8c6c007..130bbe5732e4 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16.LinqService).sql index da05faaaf5b3..42d828940bb0 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16.LinqService).sql index 28dce9f87cf8..d74da1bfc883 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16.LinqService).sql index a08bea8fbfc9..d537c823ba86 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16.LinqService).sql @@ -2,93 +2,41 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16.LinqService).sql index 60754972692c..0ef8c858f9df 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16.LinqService).sql index d714e1c734e2..8e30bd71e738 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16.LinqService).sql @@ -2,23 +2,23 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16.LinqService).sql index 4bab272b729e..9755ba6055b1 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16.LinqService).sql index 6d6d58a5a412..c0d6d53c68f6 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16.LinqService).sql index b8fa54aa7d87..53b1f9483a34 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16.LinqService).sql index 146eeb3ea5f9..7f628b9b4c22 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16.LinqService).sql index a6002f7911bf..4637ca8214d2 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16.LinqService).sql index 25aeb2f309ff..c87315544fac 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,1).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,1).sql index 6f9e9a08c288..519dc6490e94 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,1).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,2).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,2).sql index 6f9e9a08c288..519dc6490e94 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,2).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,1).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,1).sql index a6002f7911bf..4637ca8214d2 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,1).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,2).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,2).sql index a6002f7911bf..4637ca8214d2 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,2).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16.LinqService).sql index cf39fff220c3..55eeef71851b 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16.LinqService).sql index a6002f7911bf..4637ca8214d2 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16.LinqService).sql index 25aeb2f309ff..c87315544fac 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16.LinqService).sql index eed86d589df2..b58147db59c0 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16.LinqService).sql index 2830feae6450..4f34d373ae29 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16.LinqService).sql index 146eeb3ea5f9..7f628b9b4c22 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16.LinqService).sql index cf39fff220c3..55eeef71851b 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16.LinqService).sql index 73a2a6623b69..f98644c60da1 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16.LinqService).sql index cd9ea2cd37f7..d01585ac523e 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16.LinqService).sql index cd9ea2cd37f7..d01585ac523e 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16.LinqService).sql index 0f78c662b90f..23d884f7e160 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16.LinqService).sql index 0f78c662b90f..23d884f7e160 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.16.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16.LinqService).sql index e78136b54889..374b6546d98c 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..21800d47b9a5 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.16.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value2", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value3", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value3") +FROM + "SampleClass" t +ORDER BY + t."Id" + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..423e4213dfc5 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.16.LinqService).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..58e1b296b303 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.16.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..74825fe27428 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.16.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..0aee8792fca8 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.16.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..fb119487bc2f --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.16.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..fb119487bc2f --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.16.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..8cbdf3c9a74d --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.16.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..98cfcebf9b8b --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.16.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..b44640c63508 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.16.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..8b893de4e0e2 --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.16.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..72f752a0dc9a --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.16.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.16.LinqService).sql new file mode 100644 index 000000000000..c14c54fc1b6d --- /dev/null +++ b/PostgreSQL.16.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.16.LinqService).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16.LinqService).sql index 3e37292537ec..0bcad15af119 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16.LinqService).sql index 91addc37e012..6be3645caba2 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.16.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16.LinqService).sql index 3493aa8d5dc8..3e3c3b708f91 100644 --- a/PostgreSQL.16.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16.LinqService).sql @@ -2,12 +2,12 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.16.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.16.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 68922e35b540..43b8bc773907 100644 --- a/PostgreSQL.16.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.16.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16.LinqService).sql index 54b9b6953279..14d94ed48ae9 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16.LinqService).sql index 043453f2a173..e43f1678351e 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16.LinqService).sql index 44049f6f08a0..9e833d804038 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16.LinqService).sql index 423350455baa..c4d5b9a7fceb 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16.LinqService).sql index 6347242119c0..e25bc7a38e6c 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16.LinqService).sql index cb1ad6ed8a65..0ddca542128c 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.16.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16.LinqService).sql index 09a14e184a99..642df52e31d0 100644 --- a/PostgreSQL.16.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16.LinqService).sql index 79147a855288..5dc2c3e9291d 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16.LinqService).sql b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16.LinqService).sql index 79147a855288..5dc2c3e9291d 100644 --- a/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16.LinqService).sql +++ b/PostgreSQL.16.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.16/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.16).sql b/PostgreSQL.16/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.16).sql index 988aa613d22a..b6e702ababb9 100644 --- a/PostgreSQL.16/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.16).sql @@ -96,6 +96,12 @@ WHERE t1."IntValue" > ANY(t2."IntArray") OR t1."IntValue" >= ANY(t2."IntArray") OR t1."IntValue" <> ANY(t2."IntArray") OR + t1."IntValue" = ANY(t2."IntArray") OR + t1."IntValue" < ANY(t2."IntArray") OR + t1."IntValue" <= ANY(t2."IntArray") OR + t1."IntValue" > ANY(t2."IntArray") OR + t1."IntValue" >= ANY(t2."IntArray") OR + t1."IntValue" <> ANY(t2."IntArray") OR t1."IntValue" = ANY(:arr) OR t1."IntValue" < ANY(:arr) OR t1."IntValue" <= ANY(:arr) OR diff --git a/PostgreSQL.16/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.16).sql new file mode 100644 index 000000000000..5f6adf993e32 --- /dev/null +++ b/PostgreSQL.16/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.16).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.16/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.16).sql new file mode 100644 index 000000000000..c1a366c4a782 --- /dev/null +++ b/PostgreSQL.16/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.16).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.16/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16).sql index b4d067901d6a..66799ba0794a 100644 --- a/PostgreSQL.16/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.16).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.16/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16).sql index 83367afab8f0..7c12d9737b1a 100644 --- a/PostgreSQL.16/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.16).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.16/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16,False).sql b/PostgreSQL.16/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16,False).sql index 1942620e575e..69774d79ccce 100644 --- a/PostgreSQL.16/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16,False).sql +++ b/PostgreSQL.16/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.16,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.16/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16).sql index f703082095aa..056a438def2c 100644 --- a/PostgreSQL.16/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.16).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16).sql index 9e613258fb48..4f1b7c38d02c 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.16).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16).sql index e8777c444ca1..9d400559d81b 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.16).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16).sql index 72aace32e470..39acaaaba37a 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.16).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16).sql index 3cde24036d1a..98a664a61149 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.16).sql @@ -2,22 +2,22 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16).sql index 3cde24036d1a..98a664a61149 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.16).sql @@ -2,22 +2,22 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16).sql index d68e3672dcc8..978ee9e7d75f 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.16).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16).sql index ad9676ce03ed..d5429994aa09 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.16).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16).sql index fa13b5225209..75565cf54d46 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.16).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16).sql index c71becec3e28..9695ed128727 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.16).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16).sql index 12de405d079b..725f9fbc58ce 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.16).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16).sql index 12de405d079b..725f9fbc58ce 100644 --- a/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.16).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.16/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16).sql new file mode 100644 index 000000000000..867a1d950974 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.16).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.16/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16).sql index 6ec8374c3a56..cebf38e44149 100644 --- a/PostgreSQL.16/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.16).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.16).sql index 254edd4d78fc..f6885f8584a0 100644 --- a/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.16).sql @@ -2,7 +2,6 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" "a_Style" ON t3."StyleId" = "a_Style"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - ("a_Color"."Name",t2."COUNT_1",0,"a_Style"."Name",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1","a_Style"."Name",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,"a_Style"."Name",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,"a_Style"."Name",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" "a_Color" ON t3."ColorId" = "a_Color"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 LEFT JOIN LATERAL (VALUES - ("a_Color"."Name",t2."COUNT_1",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END), (NULL,0,NULL) diff --git a/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.16).sql index e30b78d8bf22..4532e3ad9ee1 100644 --- a/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.16).sql @@ -2,7 +2,6 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -35,21 +34,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - (t1."ColorName",t1."Count_1",0,t1."StyleName",CASE + (t1."ColorName",t1."Count_1",t1."StyleName",CASE WHEN t1."ColorName" = 'Red' THEN t1."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,t1."StyleName",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,t1."StyleName",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 diff --git a/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.16).sql index 8999f07f456f..9c9679df1b67 100644 --- a/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.16).sql @@ -20,7 +20,7 @@ FROM (VALUES ("a_Color"."Name","a_Style"."Name",( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 )), diff --git a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16).sql index 6c75405f9ecd..829809b7c10d 100644 --- a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.16).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16).sql index 167f127c5f0e..6d08e7c268f8 100644 --- a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.16).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16).sql index 683babd13b6f..34c1e2866e57 100644 --- a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.16).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16).sql index 3810c4eda3aa..a8de52829da3 100644 --- a/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.16).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16).sql index 83a5abbe8730..150bec41a582 100644 --- a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.16).sql @@ -2,93 +2,41 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16).sql index f53d4ee019ef..63a15682c7c9 100644 --- a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.16).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16).sql index cb84cc5b8a2a..6659768e734d 100644 --- a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.16).sql @@ -2,23 +2,23 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16).sql index 63c1bcf539a1..9e308a1a27c8 100644 --- a/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.16).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16).sql index a89b2e0be650..79f26beba428 100644 --- a/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.16).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16).sql index e75fa25a7521..830134fa7b3f 100644 --- a/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.16).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16).sql index 2017e58c24ac..cb637a0c75e9 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.16).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16).sql index 3156942730fc..f1e7b67ab4b0 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.16).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16).sql index 1dc1b9733e28..2327ffaf8b4c 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.16).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,1).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,1).sql index 3e44f2e289ba..6f673fa78474 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,1).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,2).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,2).sql index 3e44f2e289ba..6f673fa78474 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,2).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,1).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,1).sql index 3156942730fc..f1e7b67ab4b0 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,1).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,2).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,2).sql index 3156942730fc..f1e7b67ab4b0 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,2).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.16,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16).sql index 3e91ac746368..413b21ab8447 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.16).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16).sql index 3156942730fc..f1e7b67ab4b0 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.16).sql @@ -2,7 +2,7 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16).sql index 1dc1b9733e28..2327ffaf8b4c 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.16).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16).sql index 4a85a7fe26b3..c01b32b10e54 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.16).sql @@ -2,9 +2,17 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16).sql index f2eb4c0dcd85..0fb01d9c7b58 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.16).sql @@ -2,9 +2,17 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16).sql index 2017e58c24ac..cb637a0c75e9 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.16).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16).sql index 3e91ac746368..413b21ab8447 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.16).sql @@ -2,13 +2,18 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16).sql index 6dfc7c561e3d..a3c9d3ba1c88 100644 --- a/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.16).sql @@ -2,9 +2,17 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16).sql index 3302dffbe911..ab726bbdae30 100644 --- a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.16).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16).sql index 3302dffbe911..ab726bbdae30 100644 --- a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.16).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16).sql index dbdfd903988e..134b8db9dcfb 100644 --- a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.16).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16).sql index dbdfd903988e..134b8db9dcfb 100644 --- a/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.16).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.16/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16).sql index de05261b9d81..1b86ece7ca94 100644 --- a/PostgreSQL.16/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.16).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.16/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.16).sql index ad8638af10f0..dcb06741afb7 100644 --- a/PostgreSQL.16/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.16).sql @@ -2,17 +2,21 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value2") + Coalesce(t."Value2", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value3") + Coalesce(t."Value3", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.16 PostgreSQL.15 PostgreSQL @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value3") FROM "SampleClass" t +ORDER BY + t."Id" diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.16).sql new file mode 100644 index 000000000000..312320ebafb1 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.16).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.16).sql new file mode 100644 index 000000000000..dce421a0d8e7 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.16).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.16).sql new file mode 100644 index 000000000000..b72e0b5dd80b --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.16).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.16).sql new file mode 100644 index 000000000000..6d1fb418a97b --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.16).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.16).sql new file mode 100644 index 000000000000..fb119487bc2f --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.16).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.16).sql new file mode 100644 index 000000000000..d735830f4a83 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.16).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.16).sql new file mode 100644 index 000000000000..8ad857b456b1 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.16).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.16).sql new file mode 100644 index 000000000000..c2b459e08643 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.16).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.16).sql new file mode 100644 index 000000000000..755a4e8a6ed3 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.16).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.16).sql new file mode 100644 index 000000000000..e3f08be5bf46 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.16).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.16).sql new file mode 100644 index 000000000000..2e013ba9ff05 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.16).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.16).sql new file mode 100644 index 000000000000..1f8458deef00 --- /dev/null +++ b/PostgreSQL.16/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.16).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16).sql index e5bbfab2d30d..1b0905cb0e52 100644 --- a/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.16).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16).sql index 728926c030aa..fa13a14d1d05 100644 --- a/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.16).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.16/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16).sql b/PostgreSQL.16/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16).sql index f0f96e285e7b..ffa351b2b338 100644 --- a/PostgreSQL.16/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.16).sql @@ -2,12 +2,12 @@ -- PostgreSQL.16 PostgreSQL.15 PostgreSQL SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.16/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.16/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 7132a0bdce66..d49b229be07b 100644 --- a/PostgreSQL.16/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.16/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.16,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16).sql index b8bd91c0d8a7..8f70292caf5e 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.16).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16).sql index aa5c4d8787d4..122e9426649d 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.16).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.16).sql index 3f131c63e82b..55d6d087aae1 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.16).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.16).sql index 3f131c63e82b..55d6d087aae1 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.16).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.16/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.16).sql index 761ad6a535f4..d7c945aceb6e 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.16).sql @@ -59,35 +59,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.16/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16).sql index c814d047c839..218274287aa7 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.16).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.16/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16).sql index a22d94f02bd7..770da365452e 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.16).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16).sql index 32e0d1e57a5f..9e71215b5ce6 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.16).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16).sql index f09e8ae15df6..6090a53c13f3 100644 --- a/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.16).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.16/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16).sql index 57e389eecc1e..e980104de7db 100644 --- a/PostgreSQL.16/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.16).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16).sql index 863505ad9eb5..b1efd984b064 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.16).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16).sql b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16).sql index 863505ad9eb5..b1efd984b064 100644 --- a/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16).sql +++ b/PostgreSQL.16/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.16).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql b/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql index de0253d7f486..aec298db582c 100644 --- a/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql +++ b/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."Issue4626AnyValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", ANY_VALUE(d."Name") as "Issue4626AnyValue" FROM "Children" d diff --git a/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql b/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql index bc43196a3204..93ad99079fd3 100644 --- a/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql +++ b/PostgreSQL.17.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql b/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql index de0253d7f486..aec298db582c 100644 --- a/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql +++ b/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."Issue4626AnyValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", ANY_VALUE(d."Name") as "Issue4626AnyValue" FROM "Children" d diff --git a/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql b/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql index bc43196a3204..93ad99079fd3 100644 --- a/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql +++ b/PostgreSQL.17.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.17.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..86c5ec348dd5 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.17.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.17.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..53e2c39374f1 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.17.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.17.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17.LinqService).sql index 0a78bc6d33d6..39c818f5e5a0 100644 --- a/PostgreSQL.17.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17.LinqService).sql index bf4fdc9f1058..fe6321d7f164 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.17.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17.LinqService,False).sql b/PostgreSQL.17.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17.LinqService,False).sql index 082799acbcb2..6a2eb0c7b49c 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17.LinqService,False).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17.LinqService,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.17.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17.LinqService).sql index e51e53e3add1..22febe904030 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17.LinqService).sql index 57ab913eaa83..e536aed364fd 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17.LinqService).sql index f5d36b00b71f..88b8b6359c0a 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17.LinqService).sql index 1779e355056a..c544a5d1bd38 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17.LinqService).sql index 911ff640a368..22836c5c0acd 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17.LinqService).sql index 911ff640a368..22836c5c0acd 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17.LinqService).sql index 25cd1c84e66f..31d1eaa93c90 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17.LinqService).sql index 8878b74c6a5a..b28fba3d60d5 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17.LinqService).sql index a8b7e71b3fd3..9e61debf31e7 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17.LinqService).sql index 85fe8861afc3..18f5f999e5c6 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17.LinqService).sql index 753cf97e1c7c..5002c72591ad 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17.LinqService).sql index 753cf97e1c7c..5002c72591ad 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.17.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..590e09d45b66 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17.LinqService).sql index e69c90256a1b..df089d479935 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17.LinqService).sql index 46b46ea6a26c..1ca80ba4f0c4 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17.LinqService).sql index 92061315a622..d5de2267c74f 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17.LinqService).sql index 060088ce1dee..5abfe38a6dda 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17.LinqService).sql index 71bb3a6dab1b..dddd408222c4 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17.LinqService).sql index 00e06f44762b..95f817ca9b0c 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17.LinqService).sql @@ -2,93 +2,41 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17.LinqService).sql index e859c27a4a4c..fd317de2b197 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17.LinqService).sql index e96c2c46e06d..0be1f647b9a9 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17.LinqService).sql @@ -2,23 +2,23 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17.LinqService).sql index 27f46226a84d..3e3c1b34f726 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17.LinqService).sql index a073cbcd2adc..1995a134f159 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17.LinqService).sql index 1311ed60a24c..b4d52c889186 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17.LinqService).sql index dd4c1e7d8db3..7d2deac33c96 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17.LinqService).sql index fba3757f46e7..6738637fea42 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17.LinqService).sql index f40262a0aae5..11ac1c9561c7 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,1).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,1).sql index dff7bb72edb8..e662484b2f95 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,1).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,2).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,2).sql index dff7bb72edb8..e662484b2f95 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,2).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,1).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,1).sql index fba3757f46e7..6738637fea42 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,1).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,2).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,2).sql index fba3757f46e7..6738637fea42 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,2).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17.LinqService).sql index 3690f085ea96..98987cc9b601 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17.LinqService).sql index fba3757f46e7..6738637fea42 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17.LinqService).sql index f40262a0aae5..11ac1c9561c7 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17.LinqService).sql index 239482537771..bedd72d12a8e 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17.LinqService).sql index 5fb448c23af9..8b98af73eb63 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17.LinqService).sql index dd4c1e7d8db3..7d2deac33c96 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17.LinqService).sql index 3690f085ea96..98987cc9b601 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17.LinqService).sql index 4fc95e286708..78b7e6986249 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17.LinqService).sql index a1fd6c991cf5..42add09cc2ba 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17.LinqService).sql index a1fd6c991cf5..42add09cc2ba 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17.LinqService).sql index 5d3a88847b7b..b20aa65c0fb0 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17.LinqService).sql index 5d3a88847b7b..b20aa65c0fb0 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.17.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17.LinqService).sql index 4893b26b0cf9..ff21f77335fc 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..5a8bb213ecc8 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.17.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value2", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value3", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value3") +FROM + "SampleClass" t +ORDER BY + t."Id" + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..3da3ac3d1405 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.17.LinqService).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..900146ee7376 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.17.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..1f5adef248dc --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.17.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..41f899530bad --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.17.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..0477d9649546 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.17.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..0477d9649546 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.17.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..197fa503a2dc --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.17.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..ae6cdaa532fd --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.17.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..0ae7390101ea --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.17.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..737309b6baaa --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.17.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..a0db4f5104a5 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.17.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.17.LinqService).sql new file mode 100644 index 000000000000..9bacb153cbd2 --- /dev/null +++ b/PostgreSQL.17.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.17.LinqService).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17.LinqService).sql index 31c9c8f99ec7..e0987b2d61f2 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17.LinqService).sql index 25e2a352a519..31b6579749cb 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.17.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17.LinqService).sql index 8b75e62dc97f..6eb7a5ab8722 100644 --- a/PostgreSQL.17.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17.LinqService).sql @@ -2,12 +2,12 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.17.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.17.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 3b035313d444..3c5e403b6921 100644 --- a/PostgreSQL.17.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.17.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17.LinqService).sql index 7af4c69e4cea..8ca3d8dcb70e 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17.LinqService).sql index 82d9c101693f..b0af18c4d6dc 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17.LinqService).sql index cc91dadeadc1..d62b3c5078c6 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17.LinqService).sql index ebebc62523be..e570a64d17a3 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17.LinqService).sql index 6f5261d5aee6..8eb9f161c529 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17.LinqService).sql index 2c39d0d9ad20..08f2ae13833e 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.17.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17.LinqService).sql index 88b291c273fd..809be7022e26 100644 --- a/PostgreSQL.17.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17.LinqService).sql index 8152bca95445..a09e102504e3 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17.LinqService).sql b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17.LinqService).sql index 8152bca95445..a09e102504e3 100644 --- a/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17.LinqService).sql +++ b/PostgreSQL.17.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.17/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.17).sql b/PostgreSQL.17/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.17).sql index 663fe962675a..d21fe9dbd296 100644 --- a/PostgreSQL.17/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.17).sql @@ -96,6 +96,12 @@ WHERE t1."IntValue" > ANY(t2."IntArray") OR t1."IntValue" >= ANY(t2."IntArray") OR t1."IntValue" <> ANY(t2."IntArray") OR + t1."IntValue" = ANY(t2."IntArray") OR + t1."IntValue" < ANY(t2."IntArray") OR + t1."IntValue" <= ANY(t2."IntArray") OR + t1."IntValue" > ANY(t2."IntArray") OR + t1."IntValue" >= ANY(t2."IntArray") OR + t1."IntValue" <> ANY(t2."IntArray") OR t1."IntValue" = ANY(:arr) OR t1."IntValue" < ANY(:arr) OR t1."IntValue" <= ANY(:arr) OR diff --git a/PostgreSQL.17/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.17).sql new file mode 100644 index 000000000000..20a79cc61eba --- /dev/null +++ b/PostgreSQL.17/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.17).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.17/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.17).sql new file mode 100644 index 000000000000..ef33a755dd73 --- /dev/null +++ b/PostgreSQL.17/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.17).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.17/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17).sql index 71e8d44e70ff..8c6b32048d5d 100644 --- a/PostgreSQL.17/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.17).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.17/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17).sql index f92735e50114..b3b2612b1bf0 100644 --- a/PostgreSQL.17/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.17).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.17/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17,False).sql b/PostgreSQL.17/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17,False).sql index 03e5cf00ee8b..39f6d272579f 100644 --- a/PostgreSQL.17/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17,False).sql +++ b/PostgreSQL.17/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.17,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.17/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17).sql index 9a37c40f8926..ade2a440376c 100644 --- a/PostgreSQL.17/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.17).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17).sql index f97b5d8e69b5..aac6f3a7a036 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.17).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17).sql index 0f67e92de287..2ba88f0a9f2a 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.17).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17).sql index 4dbfa42a1463..f6a272d8a171 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.17).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17).sql index 2f7aff679b2e..d59ffb079a51 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.17).sql @@ -2,22 +2,22 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17).sql index 2f7aff679b2e..d59ffb079a51 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.17).sql @@ -2,22 +2,22 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17).sql index 045ad7705eb0..62ab9ac056da 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.17).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17).sql index c0a1bf3413c8..9cbcc7666054 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.17).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17).sql index d67f276ac2b7..0fb8497cc7d8 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.17).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17).sql index a8f5d6d9be44..6818b8d226bc 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.17).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17).sql index 527495804512..d74fff928c14 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.17).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17).sql index 527495804512..d74fff928c14 100644 --- a/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.17).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.17/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17).sql new file mode 100644 index 000000000000..bd2c605b8d5e --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.17).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.17/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17).sql index c10e02cc6b4d..4e1f36545845 100644 --- a/PostgreSQL.17/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.17).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.17).sql index 842ca214a185..1f683e92eefd 100644 --- a/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.17).sql @@ -2,7 +2,6 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" "a_Style" ON t3."StyleId" = "a_Style"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - ("a_Color"."Name",t2."COUNT_1",0,"a_Style"."Name",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1","a_Style"."Name",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,"a_Style"."Name",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,"a_Style"."Name",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" "a_Color" ON t3."ColorId" = "a_Color"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 LEFT JOIN LATERAL (VALUES - ("a_Color"."Name",t2."COUNT_1",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END), (NULL,0,NULL) diff --git a/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.17).sql index 83448602b4e8..192b74aaab7c 100644 --- a/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.17).sql @@ -2,7 +2,6 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -35,21 +34,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - (t1."ColorName",t1."Count_1",0,t1."StyleName",CASE + (t1."ColorName",t1."Count_1",t1."StyleName",CASE WHEN t1."ColorName" = 'Red' THEN t1."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,t1."StyleName",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,t1."StyleName",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 diff --git a/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.17).sql index 4e182ad86b92..246ba9bd066d 100644 --- a/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.17).sql @@ -20,7 +20,7 @@ FROM (VALUES ("a_Color"."Name","a_Style"."Name",( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 )), diff --git a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17).sql index f6b769c6b3a6..232962a5189a 100644 --- a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.17).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17).sql index ea6ad9278a48..3c84c61d1796 100644 --- a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.17).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17).sql index 31a70f55249b..9ac80a2d3663 100644 --- a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.17).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17).sql index 49bed6a831eb..5bcebc530c1d 100644 --- a/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.17).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17).sql index cac1216b37e6..3762a8f74322 100644 --- a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.17).sql @@ -2,93 +2,41 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL diff --git a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17).sql index 72f950219af1..c31998c53217 100644 --- a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.17).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17).sql index 2a3545568e19..f697508dfed1 100644 --- a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.17).sql @@ -2,23 +2,23 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17).sql index bfb5dc1792de..070340d7fc06 100644 --- a/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.17).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17).sql index 51fd1c4597bb..adde2888396b 100644 --- a/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.17).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17).sql index 8b076d61e281..35124d341962 100644 --- a/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.17).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17).sql index 84de6a6238ab..2db96eba7a3d 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.17).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17).sql index ed6312c2a05b..26b708f36ed3 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.17).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17).sql index 80e97929697a..32cf75f8a57d 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.17).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,1).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,1).sql index b9b44110cb6c..a246e0f84cf2 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,1).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,2).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,2).sql index b9b44110cb6c..a246e0f84cf2 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,2).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,1).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,1).sql index ed6312c2a05b..26b708f36ed3 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,1).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,2).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,2).sql index ed6312c2a05b..26b708f36ed3 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,2).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.17,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17).sql index 2fa82995782f..bbcd0dfb235c 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.17).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17).sql index ed6312c2a05b..26b708f36ed3 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.17).sql @@ -2,7 +2,7 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17).sql index 80e97929697a..32cf75f8a57d 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.17).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17).sql index 0f8f9d3b0daf..5caccc92c9e4 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.17).sql @@ -2,9 +2,17 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17).sql index 5d318059a8d9..f9d2611ecc71 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.17).sql @@ -2,9 +2,17 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17).sql index 84de6a6238ab..2db96eba7a3d 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.17).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17).sql index 2fa82995782f..bbcd0dfb235c 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.17).sql @@ -2,13 +2,18 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17).sql index ba7affca6efa..5d6d793426de 100644 --- a/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.17).sql @@ -2,9 +2,17 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17).sql index 7e6ff4cd5d7a..81cc7c20a286 100644 --- a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.17).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17).sql index 7e6ff4cd5d7a..81cc7c20a286 100644 --- a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.17).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17).sql index 4c7fd03a118c..acf6ffe72dc3 100644 --- a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.17).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17).sql index 4c7fd03a118c..acf6ffe72dc3 100644 --- a/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.17).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.17/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17).sql index c069f8461573..cf98ac15f561 100644 --- a/PostgreSQL.17/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.17).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.17/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.17).sql index f8b23a66def5..4bea0c6e0546 100644 --- a/PostgreSQL.17/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.17).sql @@ -2,17 +2,21 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value2") + Coalesce(t."Value2", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value3") + Coalesce(t."Value3", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.17 PostgreSQL.15 PostgreSQL @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value3") FROM "SampleClass" t +ORDER BY + t."Id" diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.17).sql new file mode 100644 index 000000000000..bd16fa783ccf --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.17).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.17).sql new file mode 100644 index 000000000000..8f59e6d21d33 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.17).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.17).sql new file mode 100644 index 000000000000..5da7e1699cee --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.17).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.17).sql new file mode 100644 index 000000000000..947a16a1a93b --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.17).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.17).sql new file mode 100644 index 000000000000..0477d9649546 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.17).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.17).sql new file mode 100644 index 000000000000..cc6444030d4f --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.17).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.17).sql new file mode 100644 index 000000000000..1301b9bb5a95 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.17).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.17).sql new file mode 100644 index 000000000000..64f714483aa3 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.17).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.17).sql new file mode 100644 index 000000000000..d608c4457191 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.17).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.17).sql new file mode 100644 index 000000000000..31392b092473 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.17).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.17).sql new file mode 100644 index 000000000000..a47a58192fa0 --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.17).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.17).sql new file mode 100644 index 000000000000..4d00bf544f9c --- /dev/null +++ b/PostgreSQL.17/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.17).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17).sql index 5796cfcd3b89..27772797814a 100644 --- a/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.17).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17).sql index f2392bb23b69..3c8b04a4929e 100644 --- a/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.17).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.17/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17).sql b/PostgreSQL.17/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17).sql index 9a2878473e31..39426099a0ac 100644 --- a/PostgreSQL.17/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.17).sql @@ -2,12 +2,12 @@ -- PostgreSQL.17 PostgreSQL.15 PostgreSQL SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.17/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.17/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 263a9335b768..42d2b6b78c8e 100644 --- a/PostgreSQL.17/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.17/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.17,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17).sql index 1aa64cb579b7..b87529b73113 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.17).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17).sql index 9a30db8e1f4b..57b1572471c2 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.17).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.17).sql index 3f131c63e82b..55d6d087aae1 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.17).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.17).sql index 3f131c63e82b..55d6d087aae1 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.17).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.17/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.17).sql index fa44a568ec6a..287f05486191 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.17).sql @@ -59,35 +59,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.17/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17).sql index cf9f45435f49..164c23350bd4 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.17).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.17/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17).sql index c63786494e78..eb9a0d2cbc6a 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.17).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17).sql index 19c6840d3b40..3a0f8d56a3d4 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.17).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17).sql index 1be3821eba7f..049b14195c46 100644 --- a/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.17).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.17/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17).sql index a6ac102402ed..ffcf32a66da0 100644 --- a/PostgreSQL.17/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.17).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17).sql index cfd59770ff89..f2638aaad18f 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.17).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17).sql b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17).sql index cfd59770ff89..f2638aaad18f 100644 --- a/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17).sql +++ b/PostgreSQL.17/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.17).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql b/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql index ba4e3496f65d..a084d158414b 100644 --- a/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql +++ b/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."Issue4626AnyValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", ANY_VALUE(d."Name") as "Issue4626AnyValue" FROM "Children" d diff --git a/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql b/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql index 3ff6f2931e00..066630338f00 100644 --- a/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql +++ b/PostgreSQL.18.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql b/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql index ba4e3496f65d..a084d158414b 100644 --- a/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql +++ b/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."Issue4626AnyValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", ANY_VALUE(d."Name") as "Issue4626AnyValue" FROM "Children" d diff --git a/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql b/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql index 3ff6f2931e00..066630338f00 100644 --- a/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql +++ b/PostgreSQL.18.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql @@ -6,14 +6,14 @@ SELECT m_1."Id", d_1."Key_1", - d_1."SUM_1", + d_1."Sum_1", d_1."ToValue" FROM "Parents" m_1 INNER JOIN LATERAL ( SELECT d."ParentId" as "Key_1", - SUM(d."Id") as "SUM_1", + SUM(d."Id") as "Sum_1", STRING_AGG(d."Name", ', ') as "ToValue" FROM "Children" d diff --git a/PostgreSQL.18.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..c75863f55cad --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.18.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.18.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..ee65df5a9805 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.18.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.18.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18.LinqService).sql index ecbc8ef03484..a7209bde4f6f 100644 --- a/PostgreSQL.18.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18.LinqService).sql index 2a6cf824ee29..fabefc0e280a 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.18.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18.LinqService,False).sql b/PostgreSQL.18.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18.LinqService,False).sql index a89315b32c8e..1c3c67ced76d 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18.LinqService,False).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18.LinqService,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.18.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18.LinqService).sql index 59fb95229459..e512d31f4287 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18.LinqService).sql index b7902db2ac18..980d0c4e02bc 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18.LinqService).sql index 3c218c27874a..4b9c69079c87 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18.LinqService).sql index ca33b45d4357..d303a62f6a86 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18.LinqService).sql index 6b792529a343..9651fbb4c2fb 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18.LinqService).sql index 6b792529a343..9651fbb4c2fb 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18.LinqService).sql @@ -2,22 +2,22 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18.LinqService).sql index 0b423b25da57..b7ddb810b92a 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18.LinqService).sql index fa1d6371928a..4e52b1873eb5 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18.LinqService).sql index c0d91c82afba..13f1c10084a3 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18.LinqService).sql index 26cb6f66bb64..4930883b1ead 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18.LinqService).sql index 33e460d06566..12d306f5e18f 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18.LinqService).sql index 33e460d06566..12d306f5e18f 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.18.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..770fd07eb89b --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.18.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18.LinqService).sql index dab6b65be3b9..5ce8b06873d8 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18.LinqService).sql index a8b944884c45..8582634cda31 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18.LinqService).sql index 830a9b444951..e9b076809666 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18.LinqService).sql index 5648885afb49..b99c62b0c3a4 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18.LinqService).sql index 702e4fe1208c..508ad4d67fca 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18.LinqService).sql index 3bd4c21a3dc9..7cde7de920d0 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18.LinqService).sql @@ -2,93 +2,41 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) diff --git a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18.LinqService).sql index 2061ce59cf30..170f537b1ed6 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18.LinqService).sql index 0369c1ba2ca7..0b930148956f 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18.LinqService).sql @@ -2,23 +2,23 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18.LinqService).sql index d9a87c0bc602..2f630b74fe27 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18.LinqService).sql index 91c0d2244b4e..f0401b1a5d95 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18.LinqService).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18.LinqService).sql index d65cf10798d1..d599d29eb14d 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18.LinqService).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18.LinqService).sql index a819c355dd82..7f4cf63c728b 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18.LinqService).sql index 98073919459a..63b246e928b8 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18.LinqService).sql index 241c0f88f9f0..8a18c81ef812 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,1).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,1).sql index bc0658f5bce9..7d0eb45d4e45 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,1).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,2).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,2).sql index bc0658f5bce9..7d0eb45d4e45 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,2).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,1).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,1).sql index 98073919459a..63b246e928b8 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,1).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,2).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,2).sql index 98073919459a..63b246e928b8 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,2).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18.LinqService).sql index f3b56f13de35..09376c3db62b 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18.LinqService).sql index 98073919459a..63b246e928b8 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18.LinqService).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18.LinqService).sql index 241c0f88f9f0..8a18c81ef812 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18.LinqService).sql index d32f43ddff0c..9b9d7735b17a 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18.LinqService).sql index 6367fd86a149..70735bfc8efd 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18.LinqService).sql index a819c355dd82..7f4cf63c728b 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18.LinqService).sql index f3b56f13de35..09376c3db62b 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18.LinqService).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18.LinqService).sql index 1bf0b7df9e63..7b582f62b038 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18.LinqService).sql @@ -2,9 +2,17 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18.LinqService).sql index cfa7f7b4199a..35d061b0dae5 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18.LinqService).sql index cfa7f7b4199a..35d061b0dae5 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18.LinqService).sql index 31c883957fca..96ae810f41a2 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18.LinqService).sql index 31c883957fca..96ae810f41a2 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.18.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18.LinqService).sql index 9cdbfba9a0bd..050d03ae4fff 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..9bd2cf79d107 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.18.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value2", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + Coalesce(t."Value3", '') +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") +FROM + "SampleClass" t +ORDER BY + t."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(' -> ', t."Value3", t."Value3") +FROM + "SampleClass" t +ORDER BY + t."Id" + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..4ef38e489946 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.18.LinqService).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..c3a19d7b581d --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.18.LinqService).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..e80713d5bc17 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.18.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..10f7bba40aa4 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.18.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..48f3f2df420b --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.18.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..48f3f2df420b --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.18.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..694a0c8ffa1c --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.18.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..2430ab5726a8 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.18.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..542a0267c1f8 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.18.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..7a8c68340d05 --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.18.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..96ffd9ed8a1d --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.18.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.18.LinqService).sql new file mode 100644 index 000000000000..437aed91a73e --- /dev/null +++ b/PostgreSQL.18.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.18.LinqService).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18.LinqService).sql index c9fea3050568..ba9293ac1b0e 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) diff --git a/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18.LinqService).sql index f17d3509b5dc..a140717c125f 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18.LinqService).sql @@ -7,29 +7,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) diff --git a/PostgreSQL.18.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18.LinqService).sql index 556fb0423440..22776e7e5028 100644 --- a/PostgreSQL.18.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18.LinqService).sql @@ -2,12 +2,12 @@ -- PostgreSQL.18 PostgreSQL (asynchronously) SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.18.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.18.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index e2f74699f836..7100891e64df 100644 --- a/PostgreSQL.18.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.18.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute -- PostgreSQL.18 PostgreSQL (asynchronously) diff --git a/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18.LinqService).sql index a3e9647a7512..5cc3510540ec 100644 --- a/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18.LinqService).sql index 635b8858e74d..1d2d5a90fd88 100644 --- a/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.18.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18.LinqService).sql index a3a254c61def..c56d7a1ead3d 100644 --- a/PostgreSQL.18.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18.LinqService).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.18.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18.LinqService).sql index 0dbcbd68f9d6..2eec5c078c07 100644 --- a/PostgreSQL.18.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18.LinqService).sql index f608ddaa724a..6d78a31d780c 100644 --- a/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18.LinqService).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18.LinqService).sql index 1927048825a7..e3261f553a7f 100644 --- a/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18.LinqService).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.18.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18.LinqService).sql index 4b04f21b4db7..ff1c67fc897a 100644 --- a/PostgreSQL.18.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18.LinqService).sql index c26e135ba156..8592055b0690 100644 --- a/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18.LinqService).sql b/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18.LinqService).sql index c26e135ba156..8592055b0690 100644 --- a/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18.LinqService).sql +++ b/PostgreSQL.18.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.18/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.18).sql b/PostgreSQL.18/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.18).sql index 0b506e7f90fd..118e462102e0 100644 --- a/PostgreSQL.18/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/DataProvider/PostgreSQLExtensionsTests/Tests.DataProvider.PostgreSQLExtensionsTests.ArrayFunctions(PostgreSQL.18).sql @@ -96,6 +96,12 @@ WHERE t1."IntValue" > ANY(t2."IntArray") OR t1."IntValue" >= ANY(t2."IntArray") OR t1."IntValue" <> ANY(t2."IntArray") OR + t1."IntValue" = ANY(t2."IntArray") OR + t1."IntValue" < ANY(t2."IntArray") OR + t1."IntValue" <= ANY(t2."IntArray") OR + t1."IntValue" > ANY(t2."IntArray") OR + t1."IntValue" >= ANY(t2."IntArray") OR + t1."IntValue" <> ANY(t2."IntArray") OR t1."IntValue" = ANY(:arr) OR t1."IntValue" < ANY(:arr) OR t1."IntValue" <= ANY(:arr) OR diff --git a/PostgreSQL.18/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.18).sql new file mode 100644 index 000000000000..82cfda116575 --- /dev/null +++ b/PostgreSQL.18/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(PostgreSQL.18).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + MIN(t1."ParentID") +FROM + "Parent" t1 +WHERE + t1."ParentID" < 0 + diff --git a/PostgreSQL.18/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.18).sql new file mode 100644 index 000000000000..1413664591d3 --- /dev/null +++ b/PostgreSQL.18/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(PostgreSQL.18).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" p + diff --git a/PostgreSQL.18/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18).sql index 304e03d38b39..6b179a0c72e5 100644 --- a/PostgreSQL.18/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(PostgreSQL.18).sql @@ -4,12 +4,12 @@ SELECT /* Main */ p."ParentID", p."Value1", - t1."COUNT_1" + t1."Count_1" FROM ( SELECT /* Inline */ c_1."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY diff --git a/PostgreSQL.18/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18).sql index 33850be8651e..a2e51fc0b25c 100644 --- a/PostgreSQL.18/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(PostgreSQL.18).sql @@ -25,5 +25,5 @@ FROM GROUP BY tt."Key_1" HAVING - SUM(tt."ID") <> 0 + SUM(tt."ID") <> 0 OR SUM(tt."ID") IS NULL diff --git a/PostgreSQL.18/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18,False).sql b/PostgreSQL.18/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18,False).sql index 41a1122de764..3d708c8360a6 100644 --- a/PostgreSQL.18/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18,False).sql +++ b/PostgreSQL.18/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(PostgreSQL.18,False).sql @@ -2,27 +2,23 @@ -- PostgreSQL.18 PostgreSQL DECLARE @In Varchar -- String SET @In = NULL -DECLARE @In_1 Varchar -- String -SET @In_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" IN (:In, :In_1) + s."CEnum" IN (:In, :In) BeforeExecute -- PostgreSQL.18 PostgreSQL DECLARE @NotIn Varchar -- String SET @NotIn = NULL -DECLARE @NotIn_1 Varchar -- String -SET @NotIn_1 = NULL SELECT COUNT(*) FROM "Src" s WHERE - s."CEnum" NOT IN (:NotIn, :NotIn_1) + s."CEnum" NOT IN (:NotIn, :NotIn) diff --git a/PostgreSQL.18/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18).sql index c83433fd165d..0ae6bc4ac301 100644 --- a/PostgreSQL.18/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(PostgreSQL.18).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL SELECT - p."ID" + p."ID"::SmallInt::text FROM "LinqDataTypes" p WHERE diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18).sql index a76e603bae61..f63acf93a7bd 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(PostgreSQL.18).sql @@ -11,7 +11,7 @@ FROM "Child" g_1 GROUP BY g_1."ParentID" - ) g_2 + ) t1 WHERE - g_2."ParentID" > 2 + t1."ParentID" > 2 diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18).sql index 9b39e50223f4..00049294e899 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(PostgreSQL.18).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18).sql index 30f9722e5326..59ac422255b0 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(PostgreSQL.18).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" p - INNER JOIN "Parent" "a_Parent" ON p."ParentID" = "a_Parent"."ParentID" + "Child" ch + INNER JOIN "Parent" "a_Parent" ON ch."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18).sql index 9217caf576c2..d441f51900b7 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(PostgreSQL.18).sql @@ -2,22 +2,22 @@ -- PostgreSQL.18 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18).sql index 9217caf576c2..d441f51900b7 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(PostgreSQL.18).sql @@ -2,22 +2,22 @@ -- PostgreSQL.18 PostgreSQL SELECT - g_2."MAX_1", - g_2."COUNT_1" + 1, - g_2."COUNT_1", - g_2."COUNT_2" + g_2."Max_1", + g_2."Count_1" + 1, + g_2."Count_1", + g_2."Count_2" FROM ( SELECT - MAX(g_1."ChildID") as "MAX_1", + MAX(g_1."ChildID") as "Max_1", COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN g_1."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18).sql index ff55f8647731..647a60c8f287 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(PostgreSQL.18).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN g_1."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 OR g_2."Key_1" > 2 + g_2."Count_1" > 2 OR g_2."Key_1" > 2 diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18).sql index aadc02b1d79e..93fb5507c831 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(PostgreSQL.18).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."Key_1" < 5 + g_2."Count_1" > 2 AND g_2."Key_1" < 5 diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18).sql index 5fca5586d6d2..9b660fe9caf0 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(PostgreSQL.18).sql @@ -7,12 +7,12 @@ FROM ( SELECT g_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."COUNT_1" > 3 OR g_2."Key_1" = 1 + g_2."Count_1" > 3 OR g_2."Key_1" = 1 diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18).sql index 118629b926c7..fd8027a9f982 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(PostgreSQL.18).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL SELECT - t2."COUNT_1" + t2."COUNT_1" + t2."Count_1" + t2."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" c_1 WHERE t1."ParentID" = c_1."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" t1 ) t2 diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18).sql index 41e9bc1a4048..335b7cb27b0b 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(PostgreSQL.18).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18).sql index 41e9bc1a4048..335b7cb27b0b 100644 --- a/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(PostgreSQL.18).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children_1" WHERE - p."ParentID" = c_1."ParentID" + p."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/PostgreSQL.18/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.18).sql new file mode 100644 index 000000000000..e72823764d65 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(PostgreSQL.18).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group_1", + t1."Date_1", + t1."Amount", + t1."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY e."Id", e."Name" ORDER BY e."Name", e."Date" DESC) as "RowNumber", + e."Name", + e."Date" as "Date_1", + e."Id", + e."Group" as "Group_1", + e."Amount", + e."IsActive" + FROM + "TestData" e + ) t1 +WHERE + t1."RowNumber" = 1 +ORDER BY + t1."Name", + t1."Date_1" DESC + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."Name", + t1."Group", + t1."Date", + t1."Amount", + t1."IsActive" +FROM + "TestData" t1 + diff --git a/PostgreSQL.18/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18).sql index 4d6b07cbf837..23cbf3e0a4d5 100644 --- a/PostgreSQL.18/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(PostgreSQL.18).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + t3."DetailValue" FROM ( SELECT DISTINCT diff --git a/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.18).sql index e30ea0bb6de7..b23ac558c487 100644 --- a/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(PostgreSQL.18).sql @@ -2,7 +2,6 @@ -- PostgreSQL.18 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -17,7 +16,7 @@ FROM LEFT JOIN "SomeStyle" "a_Style" ON t3."StyleId" = "a_Style"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - ("a_Color"."Name",t2."COUNT_1",0,"a_Style"."Name",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1","a_Style"."Name",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,"a_Style"."Name",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,"a_Style"."Name",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN "SomeColor" "a_Color" ON t3."ColorId" = "a_Color"."Id" LEFT JOIN ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 ) t2 ON 1=1 LEFT JOIN LATERAL (VALUES - ("a_Color"."Name",t2."COUNT_1",CASE - WHEN "a_Color"."Name" = 'Red' THEN t2."COUNT_1" + ("a_Color"."Name",t2."Count_1",CASE + WHEN "a_Color"."Name" = 'Red' THEN t2."Count_1" ELSE 0 END), (NULL,0,NULL) diff --git a/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.18).sql index 739e03288b46..4ee3bbadc14e 100644 --- a/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(PostgreSQL.18).sql @@ -2,7 +2,6 @@ -- PostgreSQL.18 PostgreSQL SELECT - it_1.cond_1, it_1.cond, it_1."ColorName", it_1."StyleName", @@ -35,21 +34,20 @@ FROM SELECT it."ColorName", it."Count" as "Count_1", - it."index" as cond, it."StyleName", it."Conditional", it.field1, it.field2, it.field3, - 1 as cond_1 + 1 as cond FROM (VALUES - (t1."ColorName",t1."Count_1",0,t1."StyleName",CASE + (t1."ColorName",t1."Count_1",t1."StyleName",CASE WHEN t1."ColorName" = 'Red' THEN t1."Count_1" ELSE 0 END,1,2,3), - (NULL,0,1,t1."StyleName",NULL,4,5,6) - ) it("ColorName", "Count", "index", "StyleName", "Conditional", field1, field2, field3) + (NULL,0,t1."StyleName",NULL,4,5,6) + ) it("ColorName", "Count", "StyleName", "Conditional", field1, field2, field3) ) it_1 ON 1=1 WHERE it_1."ColorName" = 'Red' OR it_1."Count_1" = 0 diff --git a/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.18).sql index 44963d9f6902..e32f8e0376dd 100644 --- a/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(PostgreSQL.18).sql @@ -20,7 +20,7 @@ FROM (VALUES ("a_Color"."Name","a_Style"."Name",( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "SomeItem" t1 )), diff --git a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18).sql index 63731d1da5f9..8fc2d527db95 100644 --- a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(PostgreSQL.18).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 0 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" p diff --git a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18).sql index 720d191d795c..be5834690788 100644 --- a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(PostgreSQL.18).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > 1 + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" p diff --git a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18).sql index 911a0e54e0fe..b192f898687c 100644 --- a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(PostgreSQL.18).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 2 FROM "Parent" p diff --git a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18).sql index ad2b9ec9d4f8..489bff44f1a1 100644 --- a/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(PostgreSQL.18).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" c_1 + "Child" "a_Children" WHERE - p."ParentID" = c_1."ParentID" AND c_1."ChildID" > :n + p."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > :n ) + 4 FROM "Parent" p diff --git a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18).sql index 7faa3c512dd6..1a4618aaf0eb 100644 --- a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(PostgreSQL.18).sql @@ -2,93 +2,41 @@ -- PostgreSQL.18 PostgreSQL SELECT - t1."Key_1", - t1."COUNT_1", - t1."COUNT_2", - t1."COUNT_3", - t1."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x."DataValue" - FROM - "AggregationData" x - WHERE - x."DataValue" IS NOT NULL AND t1."Key_1" = x."GroupId" - ) x_1 - WHERE - (x_1."DataValue"::decimal % 2)::decimal = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_1."DataValue" - FROM - "AggregationData" t_1 - WHERE - t_1."DataValue" IS NOT NULL AND t1."Key_1" = t_1."GroupId" AND - (t_1."DataValue"::decimal % 2)::decimal = 0 - ) t2 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - x_2."DataValue" - FROM - "AggregationData" x_2 - WHERE - x_2."DataValue" IS NOT NULL AND t1."Key_1" = x_2."GroupId" AND - (x_2."DataValue"::decimal % 2)::decimal = 0 - ) x_3 - WHERE - (x_3."DataValue"::decimal % 2)::decimal = 0 - ), - t1."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - t_2."DataValue" - FROM - "AggregationData" t_2 - WHERE - t_2."DataValue" IS NOT NULL AND t1."Key_1" = t_2."GroupId" AND - (t_2."DataValue"::decimal % 2)::decimal = 0 - ) t3 - ) + t."GroupId", + COUNT(*), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT t."DataValue"), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN t."DataValue" + ELSE NULL + END), + COUNT(DISTINCT t."DataValue") FROM - ( - SELECT - t."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT t."DataValue") as "COUNT_4", - COUNT(CASE - WHEN (t."DataValue"::decimal % 2)::decimal = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" t - WHERE - t."DataValue" IS NOT NULL - GROUP BY - t."GroupId" - ) t1 + "AggregationData" t +WHERE + t."DataValue" IS NOT NULL +GROUP BY + t."GroupId" BeforeExecute -- PostgreSQL.18 PostgreSQL diff --git a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18).sql index 495f1b3c1cee..8c5c9f380f10 100644 --- a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(PostgreSQL.18).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" g_1 @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) g_2 WHERE - g_2."COUNT_1" > 2 AND g_2."ParentID" <> 1 + g_2."Count_1" > 2 AND g_2."ParentID" <> 1 diff --git a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18).sql index 776c4edb2e71..7cefb42d9947 100644 --- a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(PostgreSQL.18).sql @@ -2,23 +2,23 @@ -- PostgreSQL.18 PostgreSQL SELECT - g_2."MIN_2" + g_2."Min_2" FROM ( SELECT MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" g_1 GROUP BY g_1."ParentID" ) g_2 WHERE - g_2."MIN_1" IS NOT NULL + g_2."Min_1" IS NOT NULL diff --git a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18).sql index 043a8ad2be8c..88dfdf55a39b 100644 --- a/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(PostgreSQL.18).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL SELECT - g_2."MIN_1" + g_2."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN g_1."ParentID" > 2 THEN g_1."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" g_1 GROUP BY diff --git a/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18).sql index ac2f931e7250..235e00e04076 100644 --- a/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(PostgreSQL.18).sql @@ -61,14 +61,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertKey", al_group_2."AlertCode", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18).sql index 95cbca3d6cf4..05deef1fd430 100644 --- a/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(PostgreSQL.18).sql @@ -51,14 +51,14 @@ FROM trade_2."DealId" as cond_1, trade_2."ParcelId", trade_2."CounterParty", - Coalesce(t1."MAX_1", t1."CreationDate") as "LastUpdate" + t1."LastUpdate" FROM ( SELECT al_group_2."AlertCode", al_group_2."AlertKey", al_group_2."CreationDate", - MAX(au_1."TransactionDate") as "MAX_1" + Coalesce(MAX(au_1."TransactionDate"), al_group_2."CreationDate") as "LastUpdate" FROM "Alert" al_group_2 LEFT JOIN "AuditAlert" au_1 ON au_1."AlertKey" = al_group_2."AlertKey" diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18).sql index 33c177630498..3c0f539ab1f1 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(PostgreSQL.18).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18).sql index 9f2407aa1169..17e5ecea890e 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(PostgreSQL.18).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18).sql index 4c33108a2ca3..40bb8b088815 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(PostgreSQL.18).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,1).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,1).sql index 5f015f7bf4bb..90b30475a7d0 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,1).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,1).sql @@ -2,12 +2,14 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,2).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,2).sql index 5f015f7bf4bb..90b30475a7d0 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,2).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,AwayFromZero,2).sql @@ -2,12 +2,14 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT - ROUND(p."MoneyValue", 1) as c1, - p."MoneyValue" + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,1).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,1).sql index 9f2407aa1169..17e5ecea890e 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,1).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,1).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,2).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,2).sql index 9f2407aa1169..17e5ecea890e 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,2).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(PostgreSQL.18,ToEven,2).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18).sql index fc8a693da769..b2e79486b3d5 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(PostgreSQL.18).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18).sql index 9f2407aa1169..17e5ecea890e 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(PostgreSQL.18).sql @@ -2,7 +2,7 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) THEN ROUND(p."MoneyValue" / 2, 1) * 2 ELSE ROUND(p."MoneyValue", 1) - END as c1, - p."MoneyValue" + END as c1 FROM "LinqDataTypes" p ) t diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18).sql index 4c33108a2ca3..40bb8b088815 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(PostgreSQL.18).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" * 2 = ROUND(p."MoneyValue" * 2, 1) AND p."MoneyValue" <> ROUND(p."MoneyValue", 1) + THEN ROUND(p."MoneyValue" / 2, 1) * 2 + ELSE ROUND(p."MoneyValue", 1) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" * 2 = ROUND(t."MoneyValue" * 2, 1) AND t."MoneyValue" <> ROUND(t."MoneyValue", 1) - THEN ROUND(t."MoneyValue" / 2, 1) * 2 - ELSE ROUND(t."MoneyValue", 1) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18).sql index 4f8a1ab8ffb3..dc4dafdc86b0 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(PostgreSQL.18).sql @@ -2,9 +2,17 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" > 0 THEN FLOOR(p."MoneyValue" + 0.5) + ELSE CEIL(p."MoneyValue" - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue") <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18).sql index 2fe2e8edad8e..2336600c7107 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(PostgreSQL.18).sql @@ -2,9 +2,17 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue"::Float > 0 THEN FLOOR(p."MoneyValue"::Float + 0.5) + ELSE CEIL(p."MoneyValue"::Float - 0.5) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue"::Float) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18).sql index 33c177630498..3c0f539ab1f1 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(PostgreSQL.18).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18).sql index fc8a693da769..b2e79486b3d5 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(PostgreSQL.18).sql @@ -2,13 +2,18 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" - FLOOR(p."MoneyValue") = 0.5 AND (FLOOR(p."MoneyValue") % 2) = 0 + THEN FLOOR(p."MoneyValue") + ELSE ROUND(p."MoneyValue", 0) + END::Float as c1 + FROM + "LinqDataTypes" p + ) t WHERE - CASE - WHEN t."MoneyValue" - FLOOR(t."MoneyValue") = 0.5 AND (FLOOR(t."MoneyValue") % 2) = 0 - THEN FLOOR(t."MoneyValue") - ELSE ROUND(t."MoneyValue", 0) - END::Float <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18).sql index 34a040871200..7cf8b045426a 100644 --- a/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(PostgreSQL.18).sql @@ -2,9 +2,17 @@ -- PostgreSQL.18 PostgreSQL SELECT - t."MoneyValue" + t.c1 FROM - "LinqDataTypes" t + ( + SELECT + CASE + WHEN p."MoneyValue" >= 0 THEN FLOOR(p."MoneyValue" * POWER(10, 1) + 0.5) / POWER(10, 1) + ELSE CEIL(p."MoneyValue" * POWER(10, 1) - 0.5) / POWER(10, 1) + END as c1 + FROM + "LinqDataTypes" p + ) t WHERE - ROUND(t."MoneyValue", 1) <> 0 + t.c1 <> 0 diff --git a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18).sql index 1bae36ddf034..70650b145ca6 100644 --- a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(PostgreSQL.18).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18).sql index 1bae36ddf034..70650b145ca6 100644 --- a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(PostgreSQL.18).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 2 + s."Int" = 2 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 2 + s."Int" <> 2 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" = 4 + s."Int" = 4 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."Int" <> 4 + s."Int" <> 4 BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 2 OR x."NullableInt" IS NULL + s."NullableInt" = 2 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 2 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 2 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" = 4 OR x."NullableInt" IS NULL + s."NullableInt" = 4 OR s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableInt" = 4 OR x."NullableInt" IS NULL) + NOT (s."NullableInt" = 4 OR s."NullableInt" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NULL + s."NullableInt" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableInt" IS NOT NULL + s."NullableInt" IS NOT NULL diff --git a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18).sql index 39ebb28b665a..fb1db1b9be45 100644 --- a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(PostgreSQL.18).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18).sql index 39ebb28b665a..fb1db1b9be45 100644 --- a/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(PostgreSQL.18).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'abc' OR x."String" IS NULL + s."String" = 'abc' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'abc' OR x."String" IS NULL) + NOT (s."String" = 'abc' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" = 'xyz' OR x."String" IS NULL + s."String" = 'xyz' OR s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."String" = 'xyz' OR x."String" IS NULL) + NOT (s."String" = 'xyz' OR s."String" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NULL + s."String" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."String" IS NOT NULL + s."String" IS NOT NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'abc' OR x."NullableString" IS NULL + s."NullableString" = 'abc' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'abc' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'abc' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" = 'xyz' OR x."NullableString" IS NULL + s."NullableString" = 'xyz' OR s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - NOT (x."NullableString" = 'xyz' OR x."NullableString" IS NULL) + NOT (s."NullableString" = 'xyz' OR s."NullableString" IS NULL) BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NULL + s."NullableString" IS NULL BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" x + "Src" s WHERE - x."NullableString" IS NOT NULL + s."NullableString" IS NOT NULL diff --git a/PostgreSQL.18/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18).sql index 6f73ade91212..ffc2b197e138 100644 --- a/PostgreSQL.18/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(PostgreSQL.18).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), x."Key_1", x."Count_1", - x."MAX_1" + x."Max_1" FROM ( SELECT summary."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX(summary."FirstName") as "MAX_1" + MAX(summary."FirstName") as "Max_1" FROM "Person" summary GROUP BY diff --git a/PostgreSQL.18/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.18).sql index f487c0295dbc..405de632d9dd 100644 --- a/PostgreSQL.18/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(PostgreSQL.18).sql @@ -2,17 +2,21 @@ -- PostgreSQL.18 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value2") + Coalesce(t."Value2", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.18 PostgreSQL SELECT - CONCAT_WS(' -> ', t."Value3") + Coalesce(t."Value3", '') FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -21,6 +25,8 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value1", t."Value2") FROM "SampleClass" t +ORDER BY + t."Id" BeforeExecute -- PostgreSQL.18 PostgreSQL @@ -29,4 +35,6 @@ SELECT CONCAT_WS(' -> ', t."Value3", t."Value3") FROM "SampleClass" t +ORDER BY + t."Id" diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.18).sql new file mode 100644 index 000000000000..f0740d369181 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(PostgreSQL.18).sql @@ -0,0 +1,48 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + CONCAT_WS(', ', Coalesce(t."NullableValue", ''), t."NotNullableValue", Coalesce(t."VarcharValue", ''), Coalesce(t."NVarcharValue", '')), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t1(item) + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t3.item_1, ''), ', ' ORDER BY CASE + WHEN t3.item_1 IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, t3.item_1 NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t2.item as item_1 + FROM + (VALUES + (t."NotNullableValue"), (t."NotNullableValue"), + (t."NotNullableValue"), (t."NVarcharValue") + ) t2(item) + WHERE + t2.item <> 'A' OR t2.item IS NULL + ) t3 + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.18).sql new file mode 100644 index 000000000000..9c528fcd42dc --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(PostgreSQL.18).sql @@ -0,0 +1,29 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + CONCAT_WS(', ', t."NullableValue", t."NotNullableValue", t."VarcharValue", t."NVarcharValue"), + ( + SELECT + Coalesce(STRING_AGG(DISTINCT t1.item, ', ' ORDER BY t1.item), '') + FROM + (VALUES + (t."NullableValue"), (t."NotNullableValue"), + (t."VarcharValue"), (t."NVarcharValue") + ) t1(item) + ) +FROM + "SampleClass" t + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.18).sql new file mode 100644 index 000000000000..900f338bf8a7 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(PostgreSQL.18).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x.c1 +FROM + ( + SELECT + CONCAT_WS(', ', CASE + WHEN t."NullableValue" LIKE '%A%' ESCAPE '~' THEN t."NullableValue" + ELSE NULL + END, CASE + WHEN t."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN t."NotNullableValue" + ELSE NULL + END, CASE + WHEN t."VarcharValue" LIKE '%A%' ESCAPE '~' THEN t."VarcharValue" + ELSE NULL + END, CASE + WHEN t."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN t."NVarcharValue" + ELSE NULL + END) as c1 + FROM + "SampleClass" t + ) x +WHERE + LTRIM(x.c1, ' + …             

  ') <> '' + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.18).sql new file mode 100644 index 000000000000..f972efdab98c --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(PostgreSQL.18).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + Coalesce(STRING_AGG(Coalesce(t1."NullableValue", ''), ', ' ORDER BY t1."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.18).sql new file mode 100644 index 000000000000..48f3f2df420b --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(PostgreSQL.18).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.18).sql new file mode 100644 index 000000000000..654b3f6acb9a --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(PostgreSQL.18).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + Coalesce(STRING_AGG(t1."NullableValue", ', ' ORDER BY t1."NotNullableValue"), '') +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.18).sql new file mode 100644 index 000000000000..57d516ad3762 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(PostgreSQL.18).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', '), + STRING_AGG(g_1."NotNullableValue", ', ') +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.18).sql new file mode 100644 index 000000000000..962e30ee2824 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(PostgreSQL.18).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT + x."NullableValue" + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ORDER BY + x."NotNullableValue" + LIMIT 2 + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t3."NotNullableValue", ', '), '') + FROM + ( + SELECT + x_1."NotNullableValue" + FROM + "SampleClass" x_1 + WHERE + t1."Key_1" = x_1."Id" + ORDER BY + x_1."NotNullableValue" + LIMIT 2 + ) t3 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.18).sql new file mode 100644 index 000000000000..cbf970edfeb9 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(PostgreSQL.18).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce(t2."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + t."NullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" AND t."NullableValue" IS NOT NULL + ORDER BY + t."NullableValue" + ) t2 + ), + ( + SELECT + Coalesce(STRING_AGG(t4.c1, ', '), '') + FROM + ( + SELECT DISTINCT + t3.c1 + FROM + ( + SELECT + Coalesce(x."NullableValue", '') as c1 + FROM + "SampleClass" x + WHERE + t1."Key_1" = x."Id" + ) t3 + ORDER BY + t3.c1 + ) t4 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.18).sql new file mode 100644 index 000000000000..5db42c7f8160 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(PostgreSQL.18).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + g_1."Id", + Coalesce(STRING_AGG(g_1."NullableValue", ', ' ORDER BY g_1."NullableValue", g_1."Id"), ''), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.18).sql new file mode 100644 index 000000000000..4348e85ab3b0 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(PostgreSQL.18).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + g_1."Id", + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN g_1."NullableValue" <> '' THEN g_1."NullableValue" + ELSE NULL + END, ', ' ORDER BY g_1."NotNullableValue", g_1."NullableValue" DESC), ''), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce(g_1."NullableValue", ''), ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY g_1."NotNullableValue" DESC NULLS FIRST), + STRING_AGG(g_1."NotNullableValue", ', ' ORDER BY CASE + WHEN g_1."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, g_1."NotNullableValue" DESC NULLS FIRST, g_1."NullableValue" NULLS FIRST) +FROM + "SampleClass" g_1 +GROUP BY + g_1."Id" +ORDER BY + g_1."Id" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.18).sql new file mode 100644 index 000000000000..bf180889b2e4 --- /dev/null +++ b/PostgreSQL.18/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(PostgreSQL.18).sql @@ -0,0 +1,50 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Key_1", + t1."Join_1", + t1."Join_2", + t1."Join_3", + t1."Join_4", + ( + SELECT + Coalesce(STRING_AGG(t2."NotNullableValue", ', ' ORDER BY t2."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + t."NotNullableValue" + FROM + "SampleClass" t + WHERE + t1."Key_1" = t."Id" + ) t2 + ) +FROM + ( + SELECT + g_1."Id" as "Key_1", + STRING_AGG(DISTINCT Coalesce(g_1."NullableValue", ''), ', ') as "Join_1", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', '), '') as "Join_2", + Coalesce(STRING_AGG(DISTINCT g_1."NullableValue", ', ' ORDER BY g_1."NullableValue" DESC), '') as "Join_3", + STRING_AGG(DISTINCT g_1."NotNullableValue", ', ') as "Join_4" + FROM + "SampleClass" g_1 + GROUP BY + g_1."Id" + ) t1 +ORDER BY + t1."Key_1" + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."NullableValue", + t1."NotNullableValue", + t1."VarcharValue", + t1."NVarcharValue" +FROM + "SampleClass" t1 + diff --git a/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18).sql index 2a88ea09f178..ba06df93720d 100644 --- a/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(PostgreSQL.18).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18).sql index 0b03e30266df..0c64ec3a9f98 100644 --- a/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(PostgreSQL.18).sql @@ -9,29 +9,24 @@ SELECT d."Amount", d."Currency" FROM - ( - SELECT DISTINCT - x."Id" + "TransactionEntity" m_1 + INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" x + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - x."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - t1.item - FROM - (VALUES - ('A'), ('B') - ) t1(item) - ) - ) m_1 - INNER JOIN "LineEntity" d ON m_1."Id" = d."TransactionId" + m_1."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + t1.item + FROM + (VALUES + ('A'), ('B') + ) t1(item) + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.18/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18).sql b/PostgreSQL.18/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18).sql index 553c4fe6b0d9..aeb567269dc9 100644 --- a/PostgreSQL.18/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(PostgreSQL.18).sql @@ -2,12 +2,12 @@ -- PostgreSQL.18 PostgreSQL SELECT - g_1."COUNT_1" + g_1."Count_1" FROM ( SELECT c_1."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" c_1 GROUP BY @@ -16,5 +16,5 @@ FROM c_1."ParentID" > 1 ) g_1 WHERE - g_1."Key_1" > 1 AND g_1."COUNT_1" > 1 + g_1."Key_1" > 1 AND g_1."Count_1" > 1 diff --git a/PostgreSQL.18/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/PostgreSQL.18/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 611635ddccf7..0eac1d06b488 100644 --- a/PostgreSQL.18/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/PostgreSQL.18/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(PostgreSQL.18,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT d."ValB", d."ValInt" FROM - ( - SELECT DISTINCT - l1."ID", - l1."ValS" + "Issue3757Level1" m_1 + INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" l1 + "Issue3757Level2" c_1 WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" c_1 - WHERE - l1."ID" = c_1."ParentId" AND l1."ValS" LIKE :TypedProperty ESCAPE '~' AND - l1."ValS" IS NOT NULL - ) - ) m_1 - INNER JOIN "Issue3757Level2" d ON m_1."ID" = d."ParentId" + m_1."ID" = c_1."ParentId" AND m_1."ValS" LIKE :TypedProperty ESCAPE '~' AND + m_1."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18).sql index ac991ae7e124..2748a6e29984 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(PostgreSQL.18).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x_1."ParentID", x_1."CountResult", - x_1."SUM_1" + x_1."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" od_1 WHERE x."ParentID" = od_1."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" x ) x_1 diff --git a/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18).sql index 22888c6a267a..a8b5999f9583 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(PostgreSQL.18).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT x."ParentID", x."CountResult", - x."SUM_1" + x."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE o."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" o ) x diff --git a/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.18).sql index ff83f07cd4cb..e73ff6957edb 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(PostgreSQL.18).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.18).sql index ff83f07cd4cb..e73ff6957edb 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(PostgreSQL.18).sql @@ -9,17 +9,12 @@ SELECT d."ChildID" FROM ( - SELECT DISTINCT - t2."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" t1 - LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) t2 + "Child" t1 + LEFT JOIN "Parent" "a_Parent" ON t1."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) m_1 INNER JOIN "Child" d ON m_1."ParentID" = d."ParentID" diff --git a/PostgreSQL.18/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.18).sql index 3a7c0dc0d40d..1f309f8568fa 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(PostgreSQL.18).sql @@ -59,35 +59,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now Timestamp -- DateTime2 SET @now = '2020-02-29 17:54:55.123'::timestamp SELECT - m_1."Id", + m_1.id, d.category_id FROM - ( - SELECT DISTINCT - x.id as "Id" + issue_4254_media_items m_1 + INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1.id = d.media_item_id +WHERE + EXISTS( + SELECT + * + FROM + issue_4254_media_item_user_share y + WHERE + m_1.id = y.media_item_id AND y.user_id = :userId AND + y.expires_at > :now + ) OR + EXISTS( + SELECT + * FROM - issue_4254_media_items x + issue_4254_media_item_user_share y_1 WHERE - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y - WHERE - x.id = y.media_item_id AND y.user_id = :userId AND - y.expires_at > :now - ) OR - EXISTS( - SELECT - * - FROM - issue_4254_media_item_user_share y_1 - WHERE - x.id = y_1.media_item_id AND y_1.created_by_id = :userId AND - y_1.expires_at > :now - ) - ) m_1 - INNER JOIN issue_4254_media_item_to_media_item_categories d ON m_1."Id" = d.media_item_id + m_1.id = y_1.media_item_id AND y_1.created_by_id = :userId AND + y_1.expires_at > :now + ) BeforeExecute DisposeTransaction diff --git a/PostgreSQL.18/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18).sql index 16d6fa0f1217..6ccf5ec71ada 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(PostgreSQL.18).sql @@ -20,7 +20,7 @@ FROM vpc."CategoryId", pop."ProductId", COALESCE(pcc."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE(vsp."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE(vsp."Quantity",0),0) as "Quantity" FROM "OrderPeriod" op INNER JOIN "ProductsPerOrderPeriod" pop ON op."Id" = pop."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT agroup."Id", oi."ProductId", - SUM(COALESCE(oi."Quantity",0)) as "SUM_1" + SUM(COALESCE(oi."Quantity",0)) as "Quantity" FROM "OrderPeriod" agroup LEFT JOIN "OrderHeader" oh ON agroup."Id" = oh."PeriodId" diff --git a/PostgreSQL.18/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18).sql index 27e17a906855..8954dfbbba61 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(PostgreSQL.18).sql @@ -3,7 +3,7 @@ SELECT ' ' || Coalesce(t1."Value1", 0)::text, - t1."SUM_1", + t1."SubSum", EXISTS( SELECT * @@ -34,12 +34,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON c_1."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = f."ParentID" AND ("a_Parent"."Value1" = f."Value1" OR "a_Parent"."Value1" IS NULL AND f."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", f."ParentID" FROM "Parent" f ) t1 WHERE ' ' || Coalesce(t1."Value1", 0)::text LIKE '%1%' ESCAPE '~' AND - t1."SUM_1" > 0 + t1."SubSum" > 0 diff --git a/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18).sql index c76becf092ad..fc7eeec1996e 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(PostgreSQL.18).sql @@ -5,13 +5,13 @@ SELECT p1."ParentID", p1."Value1", p2."Key_1", - p2."SUM_1" + p2."Sum_1" FROM "Parent" p1 INNER JOIN ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18).sql index 1352b603c6c8..71ef96d6ba34 100644 --- a/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(PostgreSQL.18).sql @@ -3,14 +3,14 @@ SELECT t1."Key_1", - t1."SUM_1", + t1."Sum_1", p2."Key_1", p2."Sum_1" FROM ( SELECT g_1."ParentID" as "Key_1", - SUM(g_1."ParentID") as "SUM_1" + SUM(g_1."ParentID") as "Sum_1" FROM "Parent" g_1 WHERE diff --git a/PostgreSQL.18/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18).sql index c17e1578c542..269d3b584bf5 100644 --- a/PostgreSQL.18/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(PostgreSQL.18).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX(x_1."LanguageID") as "MAX_1" + MAX(x_1."LanguageID") as "Max_1" FROM "Common_Language" x_1 GROUP BY x_1."Name" ) t1 WHERE - x."LanguageID" = t1."MAX_1" OR x."LanguageID" IS NULL AND t1."MAX_1" IS NULL + x."LanguageID" = t1."Max_1" OR x."LanguageID" IS NULL AND t1."Max_1" IS NULL ) diff --git a/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18).sql b/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18).sql index a16b397f8160..717cf87cfe46 100644 --- a/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(PostgreSQL.18).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18).sql b/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18).sql index a16b397f8160..717cf87cfe46 100644 --- a/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18).sql +++ b/PostgreSQL.18/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(PostgreSQL.18).sql @@ -10,9 +10,9 @@ FROM WHERE b."ChildID" = ( SELECT - MAX(b2."ParentID") + MAX(t1."ParentID") FROM - "Child" b2 + "Child" t1 ) AND b."ChildID" = -1 AND "Parent"."ParentID" = b."ParentID" diff --git a/SQLite.Classic.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..150ad7b7f480 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.Classic.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..65d7b8db9028 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.Classic.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.LinqService).sql index 61f9911aafab..c80308913b02 100644 --- a/SQLite.Classic.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.Classic.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.LinqService).sql index efabc59aae90..3748af5b0bd6 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.Classic.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.LinqService,False).sql b/SQLite.Classic.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.LinqService,False).sql index c1b39b5f188e..3b554fe44f5b 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.LinqService,False).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.LinqService,False).sql @@ -2,27 +2,23 @@ -- SQLite.Classic SQLite (asynchronously) DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.Classic SQLite (asynchronously) DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.Classic.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.LinqService).sql index f8e773fa6d7b..9a9a2f341adb 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.LinqService).sql index c1419763c4dc..0f17b5294e6e 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.LinqService).sql index b5841ac354a1..ba98598d43f6 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.LinqService).sql index df7b65367e5a..530382da7775 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.LinqService).sql index e064155c91a5..735267a1ec9e 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.LinqService).sql index e064155c91a5..735267a1ec9e 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.LinqService).sql index a422ddc7eb7a..a3f8c7d13a92 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.LinqService).sql index 8b0be01a3abf..abe6349e0434 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.LinqService).sql index ed269ac32ff6..697229f66499 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.LinqService).sql index 9edfc7d950f0..6747b734316d 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.LinqService).sql index 9edfc7d950f0..6747b734316d 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..45f3cbf0e609 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.LinqService).sql index 153bcbf1b84d..5c4e892b8da6 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.LinqService).sql index b8bbcc5529f6..573097381dd9 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.LinqService).sql index 9178ca2762b7..a8fce186e4a2 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.LinqService).sql index 3d58abe10a9b..5538a2839796 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.LinqService).sql index dfd5dfa20c3b..9ad89b285b4c 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.LinqService).sql index bfdfa194b725..9e40f806faeb 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.LinqService).sql @@ -2,93 +2,41 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.LinqService).sql index 92190b7a8788..c57fe2b09710 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.LinqService).sql index b8dc5cf29120..69068c211eb5 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.LinqService).sql @@ -2,23 +2,23 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.LinqService).sql index a06d43305029..62daa6734172 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.LinqService).sql index f4c0e4e73b47..149f0ddfd413 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.LinqService).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.LinqService).sql index 8fcdbfd7085a..be6d84adcd2b 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.LinqService).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.LinqService).sql index 600fcee229a8..731fbb3f72b0 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.LinqService).sql index 3b909b6d9e4c..773719a091cf 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.LinqService).sql index 6379c55cdc1b..87555a6156d9 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.LinqService).sql index f92d1812afc1..af91d9cdf25b 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.LinqService).sql index 3b909b6d9e4c..773719a091cf 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.LinqService).sql index 6379c55cdc1b..87555a6156d9 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.LinqService).sql index 59b1923f3afd..c4fdcd55e3a7 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.LinqService).sql index aa1588a57ae1..96d34a8a147c 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.LinqService).sql index 600fcee229a8..731fbb3f72b0 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.LinqService).sql index f92d1812afc1..af91d9cdf25b 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.LinqService).sql index 203e8b34c161..1b68daa819c9 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.LinqService).sql index 203e8b34c161..1b68daa819c9 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.LinqService).sql index 85c68ac8ce55..f305403059f6 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.LinqService).sql index 85c68ac8ce55..f305403059f6 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.LinqService).sql index 662cc37b3c16..92b59b6ce772 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..0fd72dc40736 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[Value2], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..c554f2755bdd --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.LinqService).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..5262a39aa691 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.LinqService).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..36e278024961 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..af9d50b08ea0 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..24d68fd5d476 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..24d68fd5d476 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..a2590ed3f98c --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..c3cfdf4870dd --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..5bd77e75fe84 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..7a62620b0d7a --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.LinqService).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..f18376abdfe9 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.LinqService).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.LinqService).sql new file mode 100644 index 000000000000..dfa68a2ab9b4 --- /dev/null +++ b/SQLite.Classic.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.LinqService).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.LinqService).sql index ef222621924f..840ff188d0c0 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.LinqService).sql index 7010d5001c05..1b7f4b13d4b3 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.LinqService).sql index 1a5c6b0a0996..67cd5fbbc53e 100644 --- a/SQLite.Classic.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.LinqService).sql @@ -2,12 +2,12 @@ -- SQLite.Classic SQLite (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.Classic.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.Classic.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index ef444bc13dbd..347066113fb0 100644 --- a/SQLite.Classic.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.Classic.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.LinqService).sql index 3ad955801436..1ab4ae9bd503 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.LinqService).sql index d2c04a85a8d8..86ec063e7cad 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.LinqService).sql index e3fe0a9ff063..64845305b698 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.LinqService).sql index 610bf145926b..9d7572d348f2 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.LinqService).sql index 128e584fd044..2f58ab66b5d7 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.LinqService).sql index 47656ed4cae9..be044aaf22f7 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.LinqService).sql index 8751f129e00e..b813702bef4b 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.LinqService).sql b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.LinqService).sql index 8751f129e00e..b813702bef4b 100644 --- a/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.LinqService).sql +++ b/SQLite.Classic.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..fd4e74b53f1c --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..af7aeb346854 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM.LinqService).sql index 515b591ab094..d9daf02f89b3 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM.LinqService).sql index 16deebb7af6c..07f37ac907cb 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM.LinqService,False).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM.LinqService,False).sql index 44cecbd87761..6b9f790939ff 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM.LinqService,False).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM.LinqService,False).sql @@ -2,27 +2,23 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM.LinqService).sql index a1c7b330c405..ea4e447833aa 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM.LinqService).sql index 5a9fcd1c18ad..dc54164d14c3 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM.LinqService).sql index 0b19d0396105..06942846fb2b 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM.LinqService).sql index b63852850825..e8cec51c78eb 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM.LinqService).sql index ce53964dc0cd..c742219f5de2 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM.LinqService).sql index ce53964dc0cd..c742219f5de2 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM.LinqService).sql index 0660c27d0a31..eafe98df81d4 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM.LinqService).sql index 08ab5a020dff..7d574f4cc7ab 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM.LinqService).sql index 3b5bbd392221..1927bf08f179 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM.LinqService).sql index 4180ee84fb01..a04d0823a6bd 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM.LinqService).sql index 4180ee84fb01..a04d0823a6bd 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..29e8a8ec020d --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM.LinqService).sql index 782d170c94b9..2bd96ebe5417 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM.LinqService).sql index 0e2f4d2b4566..b9304f4a1a03 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM.LinqService).sql index ac9fd5a1a060..806fd40d1185 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM.LinqService).sql index 450376f83e31..28e5b8aec8f6 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM.LinqService).sql index 993726d2b4cb..5cac31067a98 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM.LinqService).sql index a7e2643b6075..c082fe9e1b08 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM.LinqService).sql @@ -2,93 +2,41 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM.LinqService).sql index e0831122802d..826fb1ad4b5b 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM.LinqService).sql index 4ec9631a8e41..c8a389b6f628 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM.LinqService).sql @@ -2,23 +2,23 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM.LinqService).sql index d33334e5161c..09596de0e2ec 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM.LinqService).sql index c7df317299d2..751869e85367 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM.LinqService).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM.LinqService).sql index 4c2f315299cc..ec0f3889cd73 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM.LinqService).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM.LinqService).sql index c2a8f17ad37c..1aedd20c154d 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM.LinqService).sql index 79d034773c31..1344d7f35f75 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM.LinqService).sql index e518cc580042..573c8efb4a22 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM.LinqService).sql index 8095fe87e5ae..92ad5b8eb0b8 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM.LinqService).sql index 79d034773c31..1344d7f35f75 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM.LinqService).sql index e518cc580042..573c8efb4a22 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM.LinqService).sql index 2c12049a7a21..d7e586891d2e 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM.LinqService).sql index f68d27acbda3..169acdc3bf70 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM.LinqService).sql index c2a8f17ad37c..1aedd20c154d 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM.LinqService).sql index 8095fe87e5ae..92ad5b8eb0b8 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM.LinqService).sql index 53e66fed1760..d75eac3407a4 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM.LinqService).sql index 53e66fed1760..d75eac3407a4 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM.LinqService).sql index 8d4320f328a1..b99c69ef4151 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM.LinqService).sql index 8d4320f328a1..b99c69ef4151 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM.LinqService).sql index 511c1f4a263d..821bfdae1d5d 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..31b7f6152e30 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[Value2], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..d605a328742e --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..e540cfff785c --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..fcee2f518f87 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..234915ef1e7b --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..96970ce44959 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..96970ce44959 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..ab0a737ce42e --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..4bcba0090cd6 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..9161f842416e --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..eebb6af5397c --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..45a05fef0ead --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPM.LinqService).sql new file mode 100644 index 000000000000..d34ffc921424 --- /dev/null +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPM.LinqService).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM.LinqService).sql index 204bc7a4649b..8a25f03a19fd 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM.LinqService).sql index d3c4b682f043..dbb2827c3006 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPM.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM.LinqService).sql index ea8cdcd7e43c..61aad4a59f46 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM.LinqService).sql @@ -2,12 +2,12 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.Classic.MPM.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.Classic.MPM.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 4d63bafff5e3..057965c96d02 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM.LinqService).sql index 172104d7c16d..d382a6ddab7c 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM.LinqService).sql index 33ecd7ee61cc..2b8032967b15 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM.LinqService).sql index 93a3fdbed21a..054816c81bf3 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM.LinqService).sql index cd47c95218e7..d50e8f0246e6 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM.LinqService).sql index 482217472069..22c8f4171519 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM.LinqService).sql index 684e11421897..ddf6af2fe3f3 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM.LinqService).sql index 2692dc6d7a4d..965c5aea11fb 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM.LinqService).sql b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM.LinqService).sql index 2692dc6d7a4d..965c5aea11fb 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM.LinqService).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPM/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..a66bc97bfa91 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPM).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.Classic.MPM/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..de30f84fad50 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPM).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.Classic.MPM/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM).sql index f8aae1177783..8acc6d6bb8d2 100644 --- a/SQLite.Classic.MPM/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPM).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.Classic.MPM/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM).sql index 6bd37c249b4d..c7cabd78f7cf 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPM).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.Classic.MPM/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM,False).sql b/SQLite.Classic.MPM/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM,False).sql index f86d59394570..e81fd754a3be 100644 --- a/SQLite.Classic.MPM/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM,False).sql +++ b/SQLite.Classic.MPM/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPM,False).sql @@ -2,27 +2,23 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.Classic.MPM/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM).sql index 15add2d3fa65..dc60f8a8b3db 100644 --- a/SQLite.Classic.MPM/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPM).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM).sql index ef5d269cd164..ae3e750dae2f 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPM).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM).sql index bdc8f70d5832..be07af9e2d1d 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPM).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM).sql index dacf322c0d8f..169d45f4c3be 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPM).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM).sql index 134f321a43a8..80e7612aace5 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPM).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM).sql index 134f321a43a8..80e7612aace5 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPM).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM).sql index dd7774c59c04..dd3571ab9e7e 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPM).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM).sql index 4043333e6897..6cea8271cc6a 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPM).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM).sql index 500cbfacf40b..0ee45390a61c 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPM).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM).sql index b8ec7624052b..1b50ad10d0d5 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPM).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM).sql index b8ec7624052b..1b50ad10d0d5 100644 --- a/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPM).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPM/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..0548ced0dbd2 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPM).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM).sql index d2f25c875642..cabafdddf219 100644 --- a/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPM).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPM).sql index f4d62a27ac09..2e177cdc05d6 100644 --- a/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPM).sql @@ -7,10 +7,10 @@ SET @take = 20 SELECT [m_2].[MasterId], - [d].[Id1], - [d].[Id2], - [d].[Value], - [d].[ByteValues] + [t3].[Id1], + [t3].[Id2], + [t3].[Value_1], + [t3].[ByteValues] FROM ( SELECT DISTINCT @@ -27,7 +27,24 @@ FROM ) [t1] INNER JOIN [DetailClass] [dd] ON [t1].[Id1] = [dd].[MasterId] ) [m_2] - INNER JOIN [MasterClass] [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [t2].[Id1] + FROM + [MasterClass] [t2] + GROUP BY + [t2].[Id1] + ) [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [mm].[Id1], + [mm].[Id2], + [mm].[Value] as [Value_1], + [mm].[ByteValues], + ROW_NUMBER() OVER (PARTITION BY [mm].[Id1] ORDER BY [mm].[Id1]) as [rn] + FROM + [MasterClass] [mm] + ) [t3] ON [t3].[Id1] = [m_2].[MasterId] AND [d].[Id1] = [t3].[Id1] AND [t3].[rn] <= 1 BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM).sql index a9c49104d2d1..d3c1704525a2 100644 --- a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPM).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM).sql index c60f13834d7a..68c6741afa4c 100644 --- a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPM).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM).sql index f00aac8c6f2e..3f4d04798d14 100644 --- a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPM).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM).sql index 432bd6f2ce84..dc9be0638a7a 100644 --- a/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPM).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM).sql index 8ecc740b934f..299b56e15919 100644 --- a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPM).sql @@ -2,93 +2,41 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite diff --git a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM).sql index 0f4c64946da4..8e81d48e94db 100644 --- a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPM).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM).sql index 1f2264b44d84..1877938ab7eb 100644 --- a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPM).sql @@ -2,23 +2,23 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM).sql index 7d9cc23f6762..34e77c9eb010 100644 --- a/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPM).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM).sql index 4e0110a02397..3e0bcb140ded 100644 --- a/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPM).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM).sql index 79765cfff354..d448e07c5ca8 100644 --- a/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPM).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPM/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPM).sql index 4facf9902cba..948ed756a2f3 100644 --- a/SQLite.Classic.MPM/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPM).sql @@ -50,25 +50,20 @@ SELECT [d].[ParentId] FROM ( - SELECT DISTINCT - [t1].[Id] + SELECT + [p].[Id] FROM - ( + [PeopleForLoadWith] [p] + WHERE + EXISTS( SELECT - [p].[Id] + * FROM - [PeopleForLoadWith] [p] + [PeopleForLoadWith] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [PeopleForLoadWith] [c_1] - WHERE - [p].[Id] = [c_1].[ParentId] - ) - LIMIT 1 - ) [t1] + [p].[Id] = [c_1].[ParentId] + ) + LIMIT 1 ) [m_1] INNER JOIN [PeopleForLoadWith] [d] ON [m_1].[Id] = [d].[ParentId] diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM).sql index 313569ebbded..de403e126bbf 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPM).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM).sql index f32020965960..ad89a1c6ac07 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPM).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM).sql index b5365c73e504..0de61436e32c 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPM).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM).sql index 03fdd95eb7ce..37824bfb9edf 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPM).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM).sql index f32020965960..ad89a1c6ac07 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPM).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM).sql index b5365c73e504..0de61436e32c 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPM).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM).sql index 1d0e32e278cc..7bda88790986 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPM).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM).sql index 69d72a22fa93..30944b6ddf4a 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPM).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM).sql index 313569ebbded..de403e126bbf 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPM).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM).sql index 03fdd95eb7ce..37824bfb9edf 100644 --- a/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPM).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM).sql index 5de065218def..391d808b68ed 100644 --- a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPM).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM).sql index 5de065218def..391d808b68ed 100644 --- a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPM).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM).sql index dc1ccb60b959..66d9692cafd3 100644 --- a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPM).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM).sql index dc1ccb60b959..66d9692cafd3 100644 --- a/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPM).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPM/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM).sql index 247fbe4d4e1d..de6ceeebd34a 100644 --- a/SQLite.Classic.MPM/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPM).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.Classic.MPM/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPM).sql index b0b9abbe4094..5a634a2c16d2 100644 --- a/SQLite.Classic.MPM/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPM).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - IFNULL([t].[Value2], '') + Coalesce([t].[Value2], '') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - IFNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - SUBSTR(((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value1]), '')) || IFNULL((' -> ' || [t].[Value2]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - SUBSTR((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value3]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) FROM [SampleClass] [t] ORDER BY diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..2775adcc3543 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPM).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..b5c01e117edd --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPM).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..77da491fe99c --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPM).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..8017d756f4a9 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPM).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..96970ce44959 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPM).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..1a6029068ace --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPM).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..5290174cd043 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPM).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..2c2e57f87f3e --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPM).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..ffa5fabfe250 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPM).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..4e2a68c24650 --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPM).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..b45c778ece7a --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPM).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPM).sql new file mode 100644 index 000000000000..83ddfa0c6b4f --- /dev/null +++ b/SQLite.Classic.MPM/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPM).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPM SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM).sql index 8c896aed6cb2..a659a4c98b8a 100644 --- a/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPM).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM).sql index fd0fb5cd465f..a4cea63f2f0b 100644 --- a/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPM).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPM/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM).sql index aeb389cd84ad..2d4f57ffdbb6 100644 --- a/SQLite.Classic.MPM/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPM).sql @@ -2,12 +2,12 @@ -- SQLite.Classic.MPM SQLite.Classic SQLite SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.Classic.MPM/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.Classic.MPM/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 5c9fdce0c260..e240c0ee90e0 100644 --- a/SQLite.Classic.MPM/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.Classic.MPM/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPM,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM).sql index c90ac4349695..5f8a29537644 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPM).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM).sql index b120d7b0d027..3ba4704aa4e5 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPM).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPM).sql index 916aed7d80ff..877fcb6d025e 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPM).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPM).sql index 916aed7d80ff..877fcb6d025e 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPM).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPM).sql index 3268f7cef5af..d7c6164d3795 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPM).sql @@ -9,7 +9,7 @@ SELECT END, CASE WHEN [i].[SettlementTotalOnIssue] IS NOT NULL THEN [i].[SettlementTotalOnIssue] - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -17,8 +17,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -26,7 +26,7 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -52,7 +52,7 @@ SELECT ELSE [r].[ReferenceNumber] END, CASE - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -60,8 +60,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -69,5 +69,5 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM).sql index 86fa08d3d307..2a9de5d941cc 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPM).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM).sql index 194a804b99d0..a89fab4f57a4 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPM).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM).sql index 692cfeee3d45..aa3a66e595e3 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPM).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPM/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM).sql index bd07506744d6..542edfd8a786 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPM).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM).sql index 23985657aeb7..ebb24e10e740 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPM).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM).sql b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM).sql index 23985657aeb7..ebb24e10e740 100644 --- a/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM).sql +++ b/SQLite.Classic.MPM/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPM).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..e1e32f77e579 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..0450074a9ee9 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU.LinqService).sql index 09eca1f0b2fa..b74176d234e2 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU.LinqService).sql index 1bbd870deba9..1c212883d8aa 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU.LinqService,False).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU.LinqService,False).sql index 017010dde847..daaaa5852c78 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU.LinqService,False).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU.LinqService,False).sql @@ -2,27 +2,23 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU.LinqService).sql index 5c4d91341f5a..62358c94f74d 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU.LinqService).sql index ed6ba14ae024..ee9223f06f61 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU.LinqService).sql index 49d16e27c4f7..1930b7db8831 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU.LinqService).sql index b28dc40ebcc7..64d7cf4c5573 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU.LinqService).sql index 8e6099bb0fa7..d7a9e0db8d57 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU.LinqService).sql index 8e6099bb0fa7..d7a9e0db8d57 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU.LinqService).sql index e58056c51725..b408479d4610 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU.LinqService).sql index 145bb0297a16..eadb9174050b 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU.LinqService).sql index a2fe59c60e7c..b0c3623bfa9b 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU.LinqService).sql index 09f6ea5f015c..b630d59a5a0a 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU.LinqService).sql index 09f6ea5f015c..b630d59a5a0a 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..acc39ac99d16 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU.LinqService).sql index 6e2fa921d0ee..48e8cf25486e 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU.LinqService).sql index 92ccf5619e13..7e83e39b120f 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU.LinqService).sql index 2ab1e260ecfa..8b6dd7f07632 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU.LinqService).sql index 241851b6fecb..cc99e7d3f718 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU.LinqService).sql index 28cb65eb4267..b142ef18b38f 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU.LinqService).sql index 480917ef65a4..38b9ec9814a9 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU.LinqService).sql @@ -2,93 +2,41 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU.LinqService).sql index 0dff8080b4f1..a8b8f006ec4e 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU.LinqService).sql index 488986dc633b..d7b78e7df042 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU.LinqService).sql @@ -2,23 +2,23 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU.LinqService).sql index aa46713c3cfa..f201a86625a1 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU.LinqService).sql index 5c84f45f7ead..dd0249ac6a26 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU.LinqService).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU.LinqService).sql index 0ccb0c6a74a7..4da63c112f1c 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU.LinqService).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU.LinqService).sql index cf90733786f6..9c3b2a48f433 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU.LinqService).sql index a05ecef48c8c..ea7e031d0b26 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU.LinqService).sql index 81047b3c267c..6e24ee4bf00c 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU.LinqService).sql index 501383d68d89..12970096f74e 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU.LinqService).sql index a05ecef48c8c..ea7e031d0b26 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU.LinqService).sql index 81047b3c267c..6e24ee4bf00c 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU.LinqService).sql index ccacd6e9582e..620b22a3ff06 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU.LinqService).sql index a8c3ab7c8537..528c609992f9 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU.LinqService).sql index cf90733786f6..9c3b2a48f433 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU.LinqService).sql index 501383d68d89..12970096f74e 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU.LinqService).sql index e5e297a277c5..e163a581d57c 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU.LinqService).sql index e5e297a277c5..e163a581d57c 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU.LinqService).sql index b09db0256cbe..aee43b89bce2 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU.LinqService).sql index b09db0256cbe..aee43b89bce2 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU.LinqService).sql index f9b7e4bb7c2b..b38597ff79c3 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..6adf641359cb --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[Value2], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..861f9f3137ff --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..4745bf0945fc --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..d3e894b874f0 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..8849912ff99b --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..23f7085146b3 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..23f7085146b3 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..c6f682bd8e3a --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..64ce210e7ebe --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..f1eb82302690 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..9ab283432e3f --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..5d34a900dea4 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPU.LinqService).sql new file mode 100644 index 000000000000..80741acf5ca7 --- /dev/null +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPU.LinqService).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU.LinqService).sql index a3b9e433ff23..f12606932ddb 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU.LinqService).sql index a960a2cb1c66..1596b27e182c 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPU.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU.LinqService).sql index cc1b6595f089..f542bb40088c 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU.LinqService).sql @@ -2,12 +2,12 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.Classic.MPU.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.Classic.MPU.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 9824134831a9..91b6147dc7f4 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU.LinqService).sql index 96fbcdca7a75..f520bf94fb44 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU.LinqService).sql index 29daa700da1a..6c6e43bed56a 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU.LinqService).sql index 38f7fe43182c..75d51ae39f81 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU.LinqService).sql index 5017b22d91b7..d8dc69040f51 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU.LinqService).sql index 50858239080d..d5e6e3e96aef 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU.LinqService).sql index 278e69535965..54fc391259ad 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU.LinqService).sql index 85c78c8d3d6d..196e89b32188 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU.LinqService).sql b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU.LinqService).sql index 85c78c8d3d6d..196e89b32188 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU.LinqService).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPU/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..6dde97406e55 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic.MPU).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.Classic.MPU/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..3c1bae076972 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic.MPU).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.Classic.MPU/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU).sql index 4ffcc1e2f893..b5ca13203798 100644 --- a/SQLite.Classic.MPU/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic.MPU).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.Classic.MPU/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU).sql index 90983f10bfbe..79a988a9ad36 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic.MPU).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.Classic.MPU/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU,False).sql b/SQLite.Classic.MPU/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU,False).sql index f7494c084866..a5474944453d 100644 --- a/SQLite.Classic.MPU/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU,False).sql +++ b/SQLite.Classic.MPU/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic.MPU,False).sql @@ -2,27 +2,23 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.Classic.MPU/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU).sql index 4c1ba1c9549a..e421db4bc8d8 100644 --- a/SQLite.Classic.MPU/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic.MPU).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU).sql index 592d65bf4ae0..29c19d111102 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic.MPU).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU).sql index a69af4a41eab..52817ab12f6c 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic.MPU).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU).sql index 1fccc185b314..8d2b63a86205 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic.MPU).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU).sql index e03ca5dfb002..1d4c0d0b2e22 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic.MPU).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU).sql index e03ca5dfb002..1d4c0d0b2e22 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic.MPU).sql @@ -2,22 +2,22 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU).sql index b35acf79b005..46d96133b333 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic.MPU).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU).sql index 56fdf75f13b6..f632418372e3 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic.MPU).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU).sql index 296599064538..639fa1a1cae2 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic.MPU).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU).sql index d8ac62b5814e..8c6ba1717624 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic.MPU).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU).sql index d8ac62b5814e..8c6ba1717624 100644 --- a/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic.MPU).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic.MPU/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..921d2755bc9c --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic.MPU).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU).sql index bc82f56efc5e..358868f8797a 100644 --- a/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic.MPU).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPU).sql index d622f73280ed..70ef030459b0 100644 --- a/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic.MPU).sql @@ -7,10 +7,10 @@ SET @take = 20 SELECT [m_2].[MasterId], - [d].[Id1], - [d].[Id2], - [d].[Value], - [d].[ByteValues] + [t3].[Id1], + [t3].[Id2], + [t3].[Value_1], + [t3].[ByteValues] FROM ( SELECT DISTINCT @@ -27,7 +27,24 @@ FROM ) [t1] INNER JOIN [DetailClass] [dd] ON [t1].[Id1] = [dd].[MasterId] ) [m_2] - INNER JOIN [MasterClass] [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [t2].[Id1] + FROM + [MasterClass] [t2] + GROUP BY + [t2].[Id1] + ) [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [mm].[Id1], + [mm].[Id2], + [mm].[Value] as [Value_1], + [mm].[ByteValues], + ROW_NUMBER() OVER (PARTITION BY [mm].[Id1] ORDER BY [mm].[Id1]) as [rn] + FROM + [MasterClass] [mm] + ) [t3] ON [t3].[Id1] = [m_2].[MasterId] AND [d].[Id1] = [t3].[Id1] AND [t3].[rn] <= 1 BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU).sql index d953c5ef8c18..bece6dd780b5 100644 --- a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic.MPU).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU).sql index e056aff5a98d..5e58e36f097c 100644 --- a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic.MPU).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU).sql index 344d2c92e1cf..e6be53d6db10 100644 --- a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic.MPU).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU).sql index 2e325286361d..1356bfbf90f4 100644 --- a/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic.MPU).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU).sql index 872dc8d045e7..19dbbe19e3f2 100644 --- a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic.MPU).sql @@ -2,93 +2,41 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite diff --git a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU).sql index 214ad2abbe28..9a2f26375b90 100644 --- a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic.MPU).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU).sql index 25e90e8548af..1e693a40f905 100644 --- a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic.MPU).sql @@ -2,23 +2,23 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU).sql index 56bc5108ed1a..b9ddd8cc8dcd 100644 --- a/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic.MPU).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU).sql index d5ea35dac5c7..ec27c3541636 100644 --- a/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic.MPU).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU).sql index d56e903c4135..fcac62dc9d3a 100644 --- a/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic.MPU).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic.MPU/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPU).sql index 48f1a1dfcdc8..1644cd01e46d 100644 --- a/SQLite.Classic.MPU/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic.MPU).sql @@ -50,25 +50,20 @@ SELECT [d].[ParentId] FROM ( - SELECT DISTINCT - [t1].[Id] + SELECT + [p].[Id] FROM - ( + [PeopleForLoadWith] [p] + WHERE + EXISTS( SELECT - [p].[Id] + * FROM - [PeopleForLoadWith] [p] + [PeopleForLoadWith] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [PeopleForLoadWith] [c_1] - WHERE - [p].[Id] = [c_1].[ParentId] - ) - LIMIT 1 - ) [t1] + [p].[Id] = [c_1].[ParentId] + ) + LIMIT 1 ) [m_1] INNER JOIN [PeopleForLoadWith] [d] ON [m_1].[Id] = [d].[ParentId] diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU).sql index 8d29b9a6413c..5604cd1923d2 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic.MPU).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU).sql index ba9d2b9ef3f1..b076f63da977 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic.MPU).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU).sql index 5f925512be82..7d224bbdca7e 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic.MPU).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU).sql index d8ae10d56b36..414cc28c3c74 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic.MPU).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU).sql index ba9d2b9ef3f1..b076f63da977 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic.MPU).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU).sql index 5f925512be82..7d224bbdca7e 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic.MPU).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU).sql index 6bd769354510..3579c43fd0e3 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic.MPU).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU).sql index 63c0c37a3153..5f7bc912e538 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic.MPU).sql @@ -2,9 +2,14 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU).sql index 8d29b9a6413c..5604cd1923d2 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic.MPU).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU).sql index d8ae10d56b36..414cc28c3c74 100644 --- a/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic.MPU).sql @@ -2,13 +2,18 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU).sql index d3a13d3ad572..2e5e7ea8caa4 100644 --- a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic.MPU).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU).sql index d3a13d3ad572..2e5e7ea8caa4 100644 --- a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic.MPU).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU).sql index 5111951abd9c..6f52848c9264 100644 --- a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic.MPU).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU).sql index 5111951abd9c..6f52848c9264 100644 --- a/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic.MPU).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic.MPU/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU).sql index b1cb0ad6891d..dc07df96bc81 100644 --- a/SQLite.Classic.MPU/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic.MPU).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.Classic.MPU/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPU).sql index 3861151a9a43..5837139be2f1 100644 --- a/SQLite.Classic.MPU/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic.MPU).sql @@ -2,7 +2,7 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - IFNULL([t].[Value2], '') + Coalesce([t].[Value2], '') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - IFNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - SUBSTR(((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value1]), '')) || IFNULL((' -> ' || [t].[Value2]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - SUBSTR((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value3]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) FROM [SampleClass] [t] ORDER BY diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..1dc645558fd8 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic.MPU).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..64aeec7e66f6 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic.MPU).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..7287caf14575 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic.MPU).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..23592ccc519b --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic.MPU).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..23f7085146b3 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic.MPU).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..d0fe950b7bd1 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic.MPU).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..95eedb8e7616 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic.MPU).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..9afdb8458e57 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic.MPU).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..942364ca32be --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic.MPU).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..0dd4f6b55240 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic.MPU).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..fce66111dc0f --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic.MPU).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPU).sql new file mode 100644 index 000000000000..03dd901dd830 --- /dev/null +++ b/SQLite.Classic.MPU/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic.MPU).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic.MPU SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU).sql index 464a20e89e18..5812f0392a38 100644 --- a/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic.MPU).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU).sql index 5e0a56e99917..1e0d0d3cb4ad 100644 --- a/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic.MPU).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPU/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU).sql index 8445507fce97..6438a7dadfc5 100644 --- a/SQLite.Classic.MPU/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic.MPU).sql @@ -2,12 +2,12 @@ -- SQLite.Classic.MPU SQLite.Classic SQLite SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.Classic.MPU/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.Classic.MPU/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 3b9eb2d371ab..85a7405e11fe 100644 --- a/SQLite.Classic.MPU/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.Classic.MPU/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic.MPU,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU).sql index f56beb20b75b..3e6bcb3db669 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic.MPU).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU).sql index 168b4ebb0b94..48c9dec57e1e 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic.MPU).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPU).sql index 916aed7d80ff..877fcb6d025e 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic.MPU).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPU).sql index 916aed7d80ff..877fcb6d025e 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic.MPU).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPU).sql index 7fbe7895ea0e..26bd48027136 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic.MPU).sql @@ -9,7 +9,7 @@ SELECT END, CASE WHEN [i].[SettlementTotalOnIssue] IS NOT NULL THEN [i].[SettlementTotalOnIssue] - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -17,8 +17,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -26,7 +26,7 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -52,7 +52,7 @@ SELECT ELSE [r].[ReferenceNumber] END, CASE - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -60,8 +60,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -69,5 +69,5 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU).sql index c8335655dead..98762304d669 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic.MPU).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU).sql index 74a7d367e2fb..71b3ef8f6d88 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic.MPU).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU).sql index 8738e9da9564..659eb0bafdd9 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic.MPU).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic.MPU/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU).sql index 8f552206820d..357911b4a575 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic.MPU).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU).sql index 359899c97436..4ab137c4529b 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic.MPU).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU).sql b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU).sql index 359899c97436..4ab137c4529b 100644 --- a/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU).sql +++ b/SQLite.Classic.MPU/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic.MPU).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic).sql b/SQLite.Classic/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic).sql new file mode 100644 index 000000000000..9bdaaf8786cb --- /dev/null +++ b/SQLite.Classic/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.Classic).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.Classic/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic).sql b/SQLite.Classic/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic).sql new file mode 100644 index 000000000000..b22a6c9f2022 --- /dev/null +++ b/SQLite.Classic/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.Classic).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.Classic/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic).sql b/SQLite.Classic/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic).sql index 0ea52aebb784..d4a7adbc2b5e 100644 --- a/SQLite.Classic/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.Classic).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.Classic/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic).sql index 269318505868..b3b4c6708e6d 100644 --- a/SQLite.Classic/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.Classic).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.Classic/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic,False).sql b/SQLite.Classic/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic,False).sql index 5eed6e9e6363..e2edec79fc70 100644 --- a/SQLite.Classic/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic,False).sql +++ b/SQLite.Classic/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.Classic,False).sql @@ -2,27 +2,23 @@ -- SQLite.Classic SQLite DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.Classic SQLite DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.Classic/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic).sql index 04a793bab301..8592605ced77 100644 --- a/SQLite.Classic/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.Classic).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic).sql index cc171341762b..e6f3a2209919 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.Classic).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic).sql index bbfcd5a71141..f01f993e9534 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.Classic).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic).sql index 6ec3ca9fbd76..17ad1a9c7724 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.Classic).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic).sql index fa091dfa6529..4abac675b012 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.Classic).sql @@ -2,22 +2,22 @@ -- SQLite.Classic SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic).sql index fa091dfa6529..4abac675b012 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.Classic).sql @@ -2,22 +2,22 @@ -- SQLite.Classic SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic).sql index f67c94842a7d..08398ce415e4 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.Classic).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic).sql index 2af0c785eb21..ea83963a370c 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.Classic).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic).sql index 2d067d2b4398..bc647a68cc74 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.Classic).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic).sql index 37d626bfce41..06f3f14329d6 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.Classic).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic).sql index 37d626bfce41..06f3f14329d6 100644 --- a/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.Classic).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.Classic/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic).sql new file mode 100644 index 000000000000..4b8f646730cc --- /dev/null +++ b/SQLite.Classic/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.Classic).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic).sql index db0528918a41..3f90e16a9d43 100644 --- a/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.Classic).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic).sql index 206cccab8617..d2a74a205b68 100644 --- a/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.Classic).sql @@ -7,10 +7,10 @@ SET @take = 20 SELECT [m_2].[MasterId], - [d].[Id1], - [d].[Id2], - [d].[Value], - [d].[ByteValues] + [t3].[Id1], + [t3].[Id2], + [t3].[Value_1], + [t3].[ByteValues] FROM ( SELECT DISTINCT @@ -27,7 +27,24 @@ FROM ) [t1] INNER JOIN [DetailClass] [dd] ON [t1].[Id1] = [dd].[MasterId] ) [m_2] - INNER JOIN [MasterClass] [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [t2].[Id1] + FROM + [MasterClass] [t2] + GROUP BY + [t2].[Id1] + ) [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [mm].[Id1], + [mm].[Id2], + [mm].[Value] as [Value_1], + [mm].[ByteValues], + ROW_NUMBER() OVER (PARTITION BY [mm].[Id1] ORDER BY [mm].[Id1]) as [rn] + FROM + [MasterClass] [mm] + ) [t3] ON [t3].[Id1] = [m_2].[MasterId] AND [d].[Id1] = [t3].[Id1] AND [t3].[rn] <= 1 BeforeExecute DisposeTransaction diff --git a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic).sql index d717d4e2d329..9386358d2002 100644 --- a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.Classic).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic).sql index 8aab2f83bfb2..33436bd3bdd4 100644 --- a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.Classic).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic).sql index 6a782140c41b..bf47b2fa522b 100644 --- a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.Classic).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic).sql index c80217b23d95..b3916a504d42 100644 --- a/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.Classic).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic).sql index d4f4672ccabf..6fe225ab4454 100644 --- a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.Classic).sql @@ -2,93 +2,41 @@ -- SQLite.Classic SQLite SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.Classic SQLite diff --git a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic).sql index c85561f9d168..190cbc60719b 100644 --- a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.Classic).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic).sql index 8a31a796c851..a6a4244461b9 100644 --- a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.Classic).sql @@ -2,23 +2,23 @@ -- SQLite.Classic SQLite SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic).sql index 7910eadf7af1..dd65b367b31d 100644 --- a/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.Classic).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic).sql index fad849e4e827..723fbd6d712b 100644 --- a/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.Classic).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic).sql index 6a2624c313ca..474ca2ac8590 100644 --- a/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.Classic).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.Classic/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic).sql index 38cf76493a9d..123f6f80cc02 100644 --- a/SQLite.Classic/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.Classic).sql @@ -50,25 +50,20 @@ SELECT [d].[ParentId] FROM ( - SELECT DISTINCT - [t1].[Id] + SELECT + [p].[Id] FROM - ( + [PeopleForLoadWith] [p] + WHERE + EXISTS( SELECT - [p].[Id] + * FROM - [PeopleForLoadWith] [p] + [PeopleForLoadWith] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [PeopleForLoadWith] [c_1] - WHERE - [p].[Id] = [c_1].[ParentId] - ) - LIMIT 1 - ) [t1] + [p].[Id] = [c_1].[ParentId] + ) + LIMIT 1 ) [m_1] INNER JOIN [PeopleForLoadWith] [d] ON [m_1].[Id] = [d].[ParentId] diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic).sql index 1dd2b65e0463..fcf4b434985d 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SQLite.Classic).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic).sql index 5df3270a0455..0ac3d5d232cf 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.Classic).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic).sql index a7f16e4d548a..86a1c6d1499e 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.Classic).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic).sql index 5ee753241c2c..6c27bb6f0bb7 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SQLite.Classic).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic).sql index 5df3270a0455..0ac3d5d232cf 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.Classic).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic).sql index a7f16e4d548a..86a1c6d1499e 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.Classic).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic).sql index 5ee56bf42542..38bb967b5bc7 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.Classic).sql @@ -2,9 +2,14 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic).sql index 291af9f1b4d2..23085e5dcf11 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.Classic).sql @@ -2,9 +2,14 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic).sql index 1dd2b65e0463..fcf4b434985d 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SQLite.Classic).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic).sql index 5ee753241c2c..6c27bb6f0bb7 100644 --- a/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SQLite.Classic).sql @@ -2,13 +2,18 @@ -- SQLite.Classic SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([p].[MoneyValue] AS Float)) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (FLOOR(CAST([t].[MoneyValue] AS Float)) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic).sql index 1e67ce9e90b0..f858dd66536e 100644 --- a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.Classic).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic).sql index 1e67ce9e90b0..f858dd66536e 100644 --- a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.Classic).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.Classic SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.Classic SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic).sql index 813401d8c600..3095bf42adbb 100644 --- a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.Classic).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic).sql index 813401d8c600..3095bf42adbb 100644 --- a/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.Classic).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.Classic SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.Classic SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.Classic SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.Classic/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic).sql index 503c40b7d9d3..4deea254855c 100644 --- a/SQLite.Classic/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.Classic).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.Classic/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic).sql index ff7e27960b79..2d2e14d971ce 100644 --- a/SQLite.Classic/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.Classic).sql @@ -2,7 +2,7 @@ -- SQLite.Classic SQLite SELECT - IFNULL([t].[Value2], '') + Coalesce([t].[Value2], '') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SQLite.Classic SQLite SELECT - IFNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SQLite.Classic SQLite SELECT - SUBSTR(((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value1]), '')) || IFNULL((' -> ' || [t].[Value2]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SQLite.Classic SQLite SELECT - SUBSTR((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value3]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) FROM [SampleClass] [t] ORDER BY diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic).sql new file mode 100644 index 000000000000..d32da38b62c2 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.Classic).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic).sql new file mode 100644 index 000000000000..68565e9641c0 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.Classic).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic).sql new file mode 100644 index 000000000000..801727506fe6 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.Classic).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic).sql new file mode 100644 index 000000000000..09ae99907101 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.Classic).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic).sql new file mode 100644 index 000000000000..24d68fd5d476 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.Classic).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic).sql new file mode 100644 index 000000000000..64552eb1946f --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.Classic).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic).sql new file mode 100644 index 000000000000..dccda3ae8051 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.Classic).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic).sql new file mode 100644 index 000000000000..10d18915c8a6 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.Classic).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic).sql new file mode 100644 index 000000000000..52d767e7f98d --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.Classic).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic).sql new file mode 100644 index 000000000000..df18e948ac02 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.Classic).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic).sql new file mode 100644 index 000000000000..20f18078c487 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.Classic).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic).sql new file mode 100644 index 000000000000..5f73d1a91209 --- /dev/null +++ b/SQLite.Classic/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.Classic).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.Classic SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic).sql index 615c751cc968..a31c91e2e15c 100644 --- a/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.Classic).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic).sql index a3c18a218493..ca7bcdec10cc 100644 --- a/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.Classic).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic).sql b/SQLite.Classic/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic).sql index 98ea77fc2d47..3a698fb46ea8 100644 --- a/SQLite.Classic/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.Classic).sql @@ -2,12 +2,12 @@ -- SQLite.Classic SQLite SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.Classic/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.Classic/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index caba10435eb6..b69755603cb4 100644 --- a/SQLite.Classic/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.Classic/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.Classic,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic).sql index 0d2c987d1be2..78b1911d10af 100644 --- a/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.Classic).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic).sql index 409a38ff6737..b246d0476b27 100644 --- a/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.Classic).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic).sql index 916aed7d80ff..877fcb6d025e 100644 --- a/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.Classic).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic).sql index 916aed7d80ff..877fcb6d025e 100644 --- a/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.Classic).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.Classic/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic).sql index 4e332e329f3c..b31034baa574 100644 --- a/SQLite.Classic/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.Classic).sql @@ -9,7 +9,7 @@ SELECT END, CASE WHEN [i].[SettlementTotalOnIssue] IS NOT NULL THEN [i].[SettlementTotalOnIssue] - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -17,8 +17,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -26,7 +26,7 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] BeforeExecute -- SQLite.Classic SQLite @@ -52,7 +52,7 @@ SELECT ELSE [r].[ReferenceNumber] END, CASE - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -60,8 +60,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -69,5 +69,5 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] diff --git a/SQLite.Classic/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic).sql index cb49738299f4..ebfba02682dc 100644 --- a/SQLite.Classic/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.Classic).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic).sql index bfd4613fa26c..85c097ac4062 100644 --- a/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.Classic).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic).sql index 54e9772e49fd..b89da3da6277 100644 --- a/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.Classic).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.Classic/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic).sql b/SQLite.Classic/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic).sql index 30a0f5cbaa42..0dcac18a0f39 100644 --- a/SQLite.Classic/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.Classic).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic).sql index 10877e21b397..376a2f9eb16e 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.Classic).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic).sql b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic).sql index 10877e21b397..376a2f9eb16e 100644 --- a/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic).sql +++ b/SQLite.Classic/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.Classic).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..a529d9a3fe9b --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..4702fb3281bd --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS.LinqService).sql index 66ae5f5c1f77..420eb3ec20c5 100644 --- a/SQLite.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS.LinqService).sql index 77489d83c768..c188b3c254eb 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS.LinqService,False).sql b/SQLite.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS.LinqService,False).sql index 5c312f7ded4f..7a7ea4be854f 100644 --- a/SQLite.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS.LinqService,False).sql +++ b/SQLite.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SQLite.MS SQLite (asynchronously) DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.MS SQLite (asynchronously) DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS.LinqService).sql index 0bc3b6a8b630..69f09b831d28 100644 --- a/SQLite.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS.LinqService).sql index 63e1049499d1..7fae51a20127 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS.LinqService).sql index 079850d37306..df38a1103f07 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS.LinqService).sql index 7892e5ce09fc..af77a4510c99 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS.LinqService).sql index 73b3a1aa0a41..cea9ed652921 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS.LinqService).sql index 73b3a1aa0a41..cea9ed652921 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS.LinqService).sql @@ -2,22 +2,22 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS.LinqService).sql index 141f7a53bb29..2d63ff62be5a 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS.LinqService).sql index f18ef6d532c5..660512a57165 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS.LinqService).sql index 4965ab62b0a0..c74be98a7420 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS.LinqService).sql index c796318b0b6e..f887492f9b8e 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS.LinqService).sql index c796318b0b6e..f887492f9b8e 100644 --- a/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..fc8fb5528832 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS.LinqService).sql index 4077e2c60d9c..b24bf65c614b 100644 --- a/SQLite.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS.LinqService).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS.LinqService).sql index f3401a496aac..059db0d36280 100644 --- a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS.LinqService).sql index 7aeea9328748..f6b980809046 100644 --- a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS.LinqService).sql index a2c4570e9360..b6f16620272d 100644 --- a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS.LinqService).sql index 68b72803b95c..240d4fe367f2 100644 --- a/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS.LinqService).sql index e2b3ae71bbda..3874a47b79e1 100644 --- a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS.LinqService).sql @@ -2,93 +2,41 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.MS SQLite (asynchronously) diff --git a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS.LinqService).sql index 62277887b81c..74f6b117bfcf 100644 --- a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS.LinqService).sql index e4fc50465c4f..63b317367f3f 100644 --- a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS.LinqService).sql @@ -2,23 +2,23 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS.LinqService).sql index c26e030f8a08..6d71ca198b48 100644 --- a/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS.LinqService).sql index c08b7d4422b0..e93ee4c69da0 100644 --- a/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS.LinqService).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS.LinqService).sql index b972c3764ee1..8095ca09edfc 100644 --- a/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS.LinqService).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS.LinqService).sql index 28744073fcc8..6baf9c559871 100644 --- a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS.LinqService).sql index cdc0375bc54b..090c2aeda7e7 100644 --- a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS.LinqService).sql index 28744073fcc8..6baf9c559871 100644 --- a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS.LinqService).sql index cdc0375bc54b..090c2aeda7e7 100644 --- a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS.LinqService).sql index ecbcffbb4d30..113d4dd4a6cf 100644 --- a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS.LinqService).sql index b2122cadc84b..5cb7f719d364 100644 --- a/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS.LinqService).sql index e9962235c8f8..a0d46f8cdf23 100644 --- a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS.LinqService).sql index e9962235c8f8..a0d46f8cdf23 100644 --- a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS.LinqService).sql index f0c76edd9c7b..7e52aacbaf17 100644 --- a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS.LinqService).sql index f0c76edd9c7b..7e52aacbaf17 100644 --- a/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS.LinqService).sql index 94311c6480ee..2024cf0560f2 100644 --- a/SQLite.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..4a70977de105 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + Coalesce([t].[Value2], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..687698f6285f --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.MS.LinqService).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..c7edc3a9ad6d --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.MS.LinqService).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..2837641cec09 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..e50189361b5b --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..da2dc5354e46 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..da2dc5354e46 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..52fe923d16fd --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.MS.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..0b5274c0cbd7 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.MS.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..c3c223d99634 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.MS.LinqService).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..37e38d1e31b5 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.MS.LinqService).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..1b7c17b28082 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.MS.LinqService).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.MS.LinqService).sql new file mode 100644 index 000000000000..8dba79f4afb0 --- /dev/null +++ b/SQLite.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.MS.LinqService).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS.LinqService).sql index 8b3213c156a0..b99b70d484bb 100644 --- a/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.MS SQLite (asynchronously) diff --git a/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS.LinqService).sql index 4baf1bf5bafd..714e276153f6 100644 --- a/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute -- SQLite.MS SQLite (asynchronously) diff --git a/SQLite.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS.LinqService).sql index a1e09b932623..d50b51c2786a 100644 --- a/SQLite.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SQLite.MS SQLite (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 22d286c3c547..e5fa5a0c6f77 100644 --- a/SQLite.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SQLite.MS SQLite (asynchronously) diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS.LinqService).sql index 07e9a448d10c..7177f04c5992 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS.LinqService).sql index 1b61b75ea01a..2f8b5fb3f945 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS.LinqService).sql index e24e5d552832..218550f7f18e 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS.LinqService).sql index e1227160a859..c9ea1ac33ca9 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS.LinqService).sql index 73b6aa9128ea..673d9e3ed849 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.MS.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS.LinqService).sql index 7d3fe3a811e7..d83e4f4006a1 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS.LinqService).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS.LinqService).sql index 97bd619f6cb9..0413b3d98d98 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS.LinqService).sql b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS.LinqService).sql index 97bd619f6cb9..0413b3d98d98 100644 --- a/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS.LinqService).sql +++ b/SQLite.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS.LinqService).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.MS).sql b/SQLite.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.MS).sql new file mode 100644 index 000000000000..73dd556cc73b --- /dev/null +++ b/SQLite.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SQLite.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SQLite.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.MS).sql b/SQLite.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.MS).sql new file mode 100644 index 000000000000..946bd90bbd46 --- /dev/null +++ b/SQLite.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SQLite.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SQLite.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS).sql b/SQLite.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS).sql index 0677e30dfaba..dc3e5c021467 100644 --- a/SQLite.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS).sql +++ b/SQLite.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SQLite.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SQLite.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS).sql index 8cff1ffcc9f5..c62cba3d9824 100644 --- a/SQLite.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SQLite.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SQLite.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS,False).sql b/SQLite.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS,False).sql index 486c5b8ac769..ea14b1aefdf8 100644 --- a/SQLite.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS,False).sql +++ b/SQLite.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SQLite.MS,False).sql @@ -2,27 +2,23 @@ -- SQLite.MS SQLite DECLARE @In VarChar -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SQLite.MS SQLite DECLARE @NotIn VarChar -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SQLite.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS).sql b/SQLite.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS).sql index 5069980a6d0b..bbcdc64dc854 100644 --- a/SQLite.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SQLite.MS).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS).sql index ef7320906968..7e1291422aff 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SQLite.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS).sql index 4e815ccd8c82..a5a631915058 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SQLite.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS).sql index 9acfd9733ca2..bcd00d8a615b 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SQLite.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS).sql index c06cfa6c5ea7..f34d68776b14 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SQLite.MS).sql @@ -2,22 +2,22 @@ -- SQLite.MS SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS).sql index c06cfa6c5ea7..f34d68776b14 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SQLite.MS).sql @@ -2,22 +2,22 @@ -- SQLite.MS SQLite SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS).sql index 78641d2d9954..2378b08a3f35 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SQLite.MS).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS).sql index 391e97711411..1357fd99ee85 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SQLite.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS).sql index 1ea2173f23ca..ca2d10eac095 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SQLite.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS).sql index 187781dd827b..140f6e3d136e 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SQLite.MS).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS).sql b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS).sql index 187781dd827b..140f6e3d136e 100644 --- a/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SQLite.MS).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SQLite.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS).sql b/SQLite.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS).sql new file mode 100644 index 000000000000..a994ec801a87 --- /dev/null +++ b/SQLite.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SQLite.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS).sql b/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS).sql index 657431f97594..95d186c2f713 100644 --- a/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SQLite.MS).sql @@ -29,7 +29,7 @@ SELECT FROM ( SELECT - * + [t3].[DetailValue] FROM ( SELECT DISTINCT diff --git a/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.MS).sql b/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.MS).sql index 9df1d5633eb9..2b8a509b0d2f 100644 --- a/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestSelectGroupBy(SQLite.MS).sql @@ -7,10 +7,10 @@ SET @take = 20 SELECT [m_2].[MasterId], - [d].[Id1], - [d].[Id2], - [d].[Value], - [d].[ByteValues] + [t3].[Id1], + [t3].[Id2], + [t3].[Value_1], + [t3].[ByteValues] FROM ( SELECT DISTINCT @@ -27,7 +27,24 @@ FROM ) [t1] INNER JOIN [DetailClass] [dd] ON [t1].[Id1] = [dd].[MasterId] ) [m_2] - INNER JOIN [MasterClass] [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [t2].[Id1] + FROM + [MasterClass] [t2] + GROUP BY + [t2].[Id1] + ) [d] ON [d].[Id1] = [m_2].[MasterId] + INNER JOIN ( + SELECT + [mm].[Id1], + [mm].[Id2], + [mm].[Value] as [Value_1], + [mm].[ByteValues], + ROW_NUMBER() OVER (PARTITION BY [mm].[Id1] ORDER BY [mm].[Id1]) as [rn] + FROM + [MasterClass] [mm] + ) [t3] ON [t3].[Id1] = [m_2].[MasterId] AND [d].[Id1] = [t3].[Id1] AND [t3].[rn] <= 1 BeforeExecute DisposeTransaction diff --git a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS).sql b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS).sql index 96719f601174..ee4581e642bc 100644 --- a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SQLite.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS).sql b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS).sql index 35a17aa755f8..201dd3ca299a 100644 --- a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SQLite.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS).sql b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS).sql index 750d81f53fb0..eeab4d0b59cc 100644 --- a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SQLite.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS).sql b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS).sql index c1517a6d7bc7..47365b028911 100644 --- a/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SQLite.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS).sql b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS).sql index b9d7343681ad..9dd6dc4e869d 100644 --- a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SQLite.MS).sql @@ -2,93 +2,41 @@ -- SQLite.MS SQLite SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - [x_1].[DataValue] % 2 = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - [t_1].[DataValue] % 2 = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - [x_2].[DataValue] % 2 = 0 - ) [x_3] - WHERE - [x_3].[DataValue] % 2 = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - [t_2].[DataValue] % 2 = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN [t].[DataValue] % 2 = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN [t].[DataValue] % 2 = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN [t].[DataValue] % 2 = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SQLite.MS SQLite diff --git a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS).sql b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS).sql index f5918965dda2..16ad5cfbe11d 100644 --- a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SQLite.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS).sql b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS).sql index 462f13e858eb..451771ed497c 100644 --- a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SQLite.MS).sql @@ -2,23 +2,23 @@ -- SQLite.MS SQLite SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS).sql b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS).sql index de4c85cc8d62..0cdf782e1367 100644 --- a/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SQLite.MS).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS).sql b/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS).sql index 26297a548213..ee9b21620a37 100644 --- a/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SQLite.MS).sql @@ -62,7 +62,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -73,7 +73,7 @@ FROM [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS).sql b/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS).sql index 1137fdbf8ba2..bd93fd728719 100644 --- a/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SQLite.MS).sql @@ -51,7 +51,7 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate], + [t1].[LastUpdate], ROW_NUMBER() OVER (PARTITION BY [t1].[AlertKey], [t1].[AlertCode], [t1].[CreationDate] ORDER BY [t1].[AlertKey]) as [rn], [t1].[AlertKey], [t1].[AlertCode], @@ -62,7 +62,7 @@ FROM [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SQLite.MS/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.MS).sql b/SQLite.MS/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.MS).sql index 8c2bd2d79d6b..59bf1f9c25f0 100644 --- a/SQLite.MS/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithChainedAfterFilter(SQLite.MS).sql @@ -50,25 +50,20 @@ SELECT [d].[ParentId] FROM ( - SELECT DISTINCT - [t1].[Id] + SELECT + [p].[Id] FROM - ( + [PeopleForLoadWith] [p] + WHERE + EXISTS( SELECT - [p].[Id] + * FROM - [PeopleForLoadWith] [p] + [PeopleForLoadWith] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [PeopleForLoadWith] [c_1] - WHERE - [p].[Id] = [c_1].[ParentId] - ) - LIMIT 1 - ) [t1] + [p].[Id] = [c_1].[ParentId] + ) + LIMIT 1 ) [m_1] INNER JOIN [PeopleForLoadWith] [d] ON [m_1].[Id] = [d].[ParentId] diff --git a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS).sql b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS).sql index d16905308d54..cee7ca17bb8b 100644 --- a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SQLite.MS).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS).sql b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS).sql index 9dccb5e70e2b..10723ac017b0 100644 --- a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SQLite.MS).sql @@ -2,13 +2,18 @@ -- SQLite.MS SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS).sql b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS).sql index d16905308d54..cee7ca17bb8b 100644 --- a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SQLite.MS).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS).sql b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS).sql index 9dccb5e70e2b..10723ac017b0 100644 --- a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SQLite.MS).sql @@ -2,13 +2,18 @@ -- SQLite.MS SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS).sql b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS).sql index da8642bd1e34..1165677c31f5 100644 --- a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SQLite.MS).sql @@ -2,9 +2,14 @@ -- SQLite.MS SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue]) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue]) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS).sql b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS).sql index 046d66a4a94e..0d8042c68fd1 100644 --- a/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SQLite.MS).sql @@ -2,9 +2,14 @@ -- SQLite.MS SQLite SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float)) <> 0 + [t].[c1] <> 0 diff --git a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS).sql b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS).sql index 9fee902970c8..8512af33f36b 100644 --- a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SQLite.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.MS SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.MS SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.MS SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.MS SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.MS SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS).sql b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS).sql index 9fee902970c8..8512af33f36b 100644 --- a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SQLite.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SQLite.MS SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SQLite.MS SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SQLite.MS SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SQLite.MS SQLite @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SQLite.MS SQLite @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS).sql b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS).sql index 5d699057f7c0..19e153f0a116 100644 --- a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SQLite.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.MS SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS).sql b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS).sql index 5d699057f7c0..19e153f0a116 100644 --- a/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SQLite.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SQLite.MS SQLite @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SQLite.MS SQLite @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SQLite.MS SQLite @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SQLite.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS).sql b/SQLite.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS).sql index a1d1b09b29e6..bfdbc76ebdad 100644 --- a/SQLite.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SQLite.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SQLite.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.MS).sql index b0e24ec67e96..1bd53f2c0bb3 100644 --- a/SQLite.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SQLite.MS).sql @@ -2,7 +2,7 @@ -- SQLite.MS SQLite SELECT - IFNULL([t].[Value2], '') + Coalesce([t].[Value2], '') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SQLite.MS SQLite SELECT - IFNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SQLite.MS SQLite SELECT - SUBSTR(((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value1]), '')) || IFNULL((' -> ' || [t].[Value2]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value1], '') || Coalesce(' -> ' || [t].[Value2], ''), 5) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SQLite.MS SQLite SELECT - SUBSTR((IFNULL((' -> ' || [t].[Value3]), '') || IFNULL((' -> ' || [t].[Value3]), '')), LENGTH(' -> ') + 1) + SUBSTR(Coalesce(' -> ' || [t].[Value3], '') || Coalesce(' -> ' || [t].[Value3], ''), 5) FROM [SampleClass] [t] ORDER BY diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.MS).sql new file mode 100644 index 000000000000..959934aceca9 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SQLite.MS).sql @@ -0,0 +1,76 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + Coalesce([t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || ', ' || Coalesce([t].[VarcharValue], '') || ', ' || Coalesce([t].[NVarcharValue], ''), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t6].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t5].[item_1] + FROM + ( + SELECT DISTINCT + [t4].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NotNullableValue]), ([t].[NotNullableValue]), + ([t].[NotNullableValue]), ([t].[NVarcharValue]) + ) [t4] + WHERE + [t4].[item] <> 'A' OR [t4].[item] IS NULL + ) [t5] + ORDER BY + CASE + WHEN [t5].[item_1] IS NULL THEN 0 + ELSE 1 + END, + [t5].[item_1] + ) [t6] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.MS).sql new file mode 100644 index 000000000000..84384a87b762 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SQLite.MS).sql @@ -0,0 +1,46 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + SUBSTR(Coalesce(', ' || [t].[NullableValue], '') || ', ' || [t].[NotNullableValue] || Coalesce(', ' || [t].[VarcharValue], '') || Coalesce(', ' || [t].[NVarcharValue], ''), 3), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[item_1], ''), ', '), '') + FROM + ( + SELECT + [t2].[item_1] + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1] + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ORDER BY + [t2].[item_1] + ) [t3] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.MS).sql new file mode 100644 index 000000000000..408602082ef7 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SQLite.MS).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [x].[c1] +FROM + ( + SELECT + SUBSTR(Coalesce(', ' || CASE + WHEN [t].[NullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NotNullableValue] LIKE '%A%' ESCAPE '~' THEN [t].[NotNullableValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[VarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[VarcharValue] + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN [t].[NVarcharValue] LIKE '%A%' ESCAPE '~' THEN [t].[NVarcharValue] + ELSE NULL + END, ''), 3) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + LTRIM([x].[c1], ' + …             

  ') <> '' + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.MS).sql new file mode 100644 index 000000000000..8a694f0f7bfd --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SQLite.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.MS).sql new file mode 100644 index 000000000000..da2dc5354e46 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SQLite.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite (asynchronously) + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.MS).sql new file mode 100644 index 000000000000..06c6bd681e56 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SQLite.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + Coalesce(GROUP_CONCAT([t2].[NullableValue], ', '), '') +FROM + ( + SELECT + [t1].[NullableValue] + FROM + [SampleClass] [t1] + ORDER BY + [t1].[NotNullableValue] + ) [t2] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.MS).sql new file mode 100644 index 000000000000..2822a793d94e --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SQLite.MS).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [g_1].[Id], + GROUP_CONCAT(Coalesce([g_1].[NullableValue], ''), ', '), + GROUP_CONCAT([g_1].[NotNullableValue], ', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.MS).sql new file mode 100644 index 000000000000..0777f98bc9ac --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SQLite.MS).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + LIMIT 2 + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t3].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t1].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + LIMIT 2 + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.MS).sql new file mode 100644 index 000000000000..5dbaf617a9ae --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingDistinctSimple(SQLite.MS).sql @@ -0,0 +1,64 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[c1], ', '), '') + FROM + ( + SELECT DISTINCT + [t3].[c1] + FROM + ( + SELECT + Coalesce([x].[NullableValue], '') as [c1] + FROM + [SampleClass] [x] + WHERE + [t1].[Key_1] = [x].[Id] + ) [t3] + ORDER BY + [t3].[c1] + ) [t4] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.MS).sql new file mode 100644 index 000000000000..384959dd9a01 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SQLite.MS).sql @@ -0,0 +1,68 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] AND [t].[NullableValue] IS NOT NULL + ORDER BY + [t].[NullableValue], + [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NullableValue] + ) [t3] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.MS).sql new file mode 100644 index 000000000000..55778ff05508 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SQLite.MS).sql @@ -0,0 +1,156 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t].[Id], + [t].[NullableValue], + [t].[NotNullableValue], + [t].[VarcharValue], + [t].[NVarcharValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ORDER BY + [t].[NotNullableValue], + [t].[NullableValue] DESC + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(CASE + WHEN [t3].[NullableValue] <> '' THEN [t3].[NullableValue] + ELSE NULL + END, ', '), '') + FROM + ( + SELECT + [t_1].[Id], + [t_1].[NullableValue], + [t_1].[NotNullableValue], + [t_1].[VarcharValue], + [t_1].[NVarcharValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] + ORDER BY + [t_1].[NotNullableValue], + [t_1].[NullableValue] DESC + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t4].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_2].[Id], + [t_2].[NullableValue], + [t_2].[NotNullableValue], + [t_2].[VarcharValue], + [t_2].[NVarcharValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] + ORDER BY + [t_2].[NotNullableValue] DESC, + [t_2].[NullableValue] DESC + ) [t4] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t_3].[Id], + [t_3].[NullableValue], + [t_3].[NotNullableValue], + [t_3].[VarcharValue], + [t_3].[NVarcharValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ORDER BY + [t_3].[NotNullableValue] DESC, + [t_3].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_4].[Id], + [t_4].[NullableValue], + [t_4].[NotNullableValue], + [t_4].[VarcharValue], + [t_4].[NVarcharValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ORDER BY + [t_4].[NotNullableValue] DESC, + [t_4].[NullableValue] DESC + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t7].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t_5].[Id], + [t_5].[NullableValue], + [t_5].[NotNullableValue], + [t_5].[VarcharValue], + [t_5].[NVarcharValue] + FROM + [SampleClass] [t_5] + WHERE + [t1].[Key_1] = [t_5].[Id] + ORDER BY + CASE + WHEN [t_5].[NullableValue] IS NULL THEN 0 + ELSE 1 + END, + [t_5].[NotNullableValue] DESC, + [t_5].[NullableValue] + ) [t7] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.MS).sql b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.MS).sql new file mode 100644 index 000000000000..a5a102e72d19 --- /dev/null +++ b/SQLite.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SQLite.MS).sql @@ -0,0 +1,108 @@ +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Key_1], + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t2].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t].[NullableValue] + FROM + [SampleClass] [t] + WHERE + [t1].[Key_1] = [t].[Id] + ) [t2] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t3].[NullableValue], ''), ', '), '') + FROM + ( + SELECT DISTINCT + [t_1].[NullableValue] + FROM + [SampleClass] [t_1] + WHERE + [t1].[Key_1] = [t_1].[Id] AND [t_1].[NullableValue] IS NOT NULL + ) [t3] + ), + ( + SELECT + Coalesce(GROUP_CONCAT(Coalesce([t5].[NullableValue], ''), ', '), '') + FROM + ( + SELECT + [t4].[NullableValue] + FROM + ( + SELECT DISTINCT + [t_2].[NullableValue] + FROM + [SampleClass] [t_2] + WHERE + [t1].[Key_1] = [t_2].[Id] AND [t_2].[NullableValue] IS NOT NULL + ) [t4] + ORDER BY + [t4].[NullableValue] DESC + ) [t5] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t6].[NotNullableValue], ', '), '') + FROM + ( + SELECT DISTINCT + [t_3].[NotNullableValue] + FROM + [SampleClass] [t_3] + WHERE + [t1].[Key_1] = [t_3].[Id] + ) [t6] + ), + ( + SELECT + Coalesce(GROUP_CONCAT([t8].[NotNullableValue], ', '), '') + FROM + ( + SELECT + [t7].[NotNullableValue] + FROM + ( + SELECT DISTINCT + [t_4].[NotNullableValue] + FROM + [SampleClass] [t_4] + WHERE + [t1].[Key_1] = [t_4].[Id] + ) [t7] + ORDER BY + [t7].[NotNullableValue] DESC + ) [t8] + ) +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t1] +ORDER BY + [t1].[Key_1] + +BeforeExecute +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS).sql b/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS).sql index 4a0e0148e19c..871ac71e4483 100644 --- a/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SQLite.MS).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS).sql b/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS).sql index b7c4a8f39f55..49071307dfdc 100644 --- a/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SQLite.MS).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT NULL [item] WHERE 1 = 0 - UNION ALL - VALUES - ('A'), ('B') - ) [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT NULL [item] WHERE 1 = 0 + UNION ALL + VALUES + ('A'), ('B') + ) [t1] + ) BeforeExecute DisposeTransaction diff --git a/SQLite.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS).sql b/SQLite.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS).sql index 1780fc203766..3a8757ce3a14 100644 --- a/SQLite.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS).sql +++ b/SQLite.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SQLite.MS).sql @@ -2,12 +2,12 @@ -- SQLite.MS SQLite SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SQLite.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SQLite.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 95b5058a8546..3d9c298e2400 100644 --- a/SQLite.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SQLite.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SQLite.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS).sql index 4117840c7ecd..bcaf58ebfb35 100644 --- a/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SQLite.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS).sql index a197a7a8ec35..855ebc00eaf1 100644 --- a/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SQLite.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.MS).sql index 1ec520e9a2ec..5e0cdd3405a0 100644 --- a/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SQLite.MS).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.MS).sql index 1ec520e9a2ec..5e0cdd3405a0 100644 --- a/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SQLite.MS).sql @@ -9,17 +9,12 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT + [a_Parent].[ParentID] FROM - ( - SELECT - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - LIMIT 1 - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] + LIMIT 1 ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SQLite.MS/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.MS).sql index 7f44dd688c0f..81347d06a7b3 100644 --- a/SQLite.MS/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue1838Tests/Tests.UserTests.Issue1838Tests.ConditionalTests(SQLite.MS).sql @@ -9,7 +9,7 @@ SELECT END, CASE WHEN [i].[SettlementTotalOnIssue] IS NOT NULL THEN [i].[SettlementTotalOnIssue] - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -17,8 +17,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -26,7 +26,7 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] BeforeExecute -- SQLite.MS SQLite @@ -52,7 +52,7 @@ SELECT ELSE [r].[ReferenceNumber] END, CASE - WHEN [ia].[InvoiceID] IS NOT NULL THEN [ia].[SUM_1] + WHEN [ia].[InvoiceId] IS NOT NULL THEN [ia].[Total] ELSE NULL END FROM @@ -60,8 +60,8 @@ FROM LEFT JOIN [InvoiceReferenceNumber] [r] ON [r].[InvoiceReferenceNumberID] = [i].[InvoiceReferenceNumberID] LEFT JOIN ( SELECT - [g_1].[InvoiceID], - SUM([ili].[BillingAmountOverride]) as [SUM_1] + [g_1].[InvoiceID] as [InvoiceId], + SUM([ili].[BillingAmountOverride]) as [Total] FROM [Invoice] [g_1] INNER JOIN [InvoiceLineItem] [ili] ON [ili].[OwningInvoiceID] = [g_1].[InvoiceID] @@ -69,5 +69,5 @@ FROM NOT [ili].[Suppressed] GROUP BY [g_1].[InvoiceID] - ) [ia] ON [ia].[InvoiceID] = [i].[InvoiceID] + ) [ia] ON [ia].[InvoiceId] = [i].[InvoiceID] diff --git a/SQLite.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS).sql index 32c74aa69e8b..bdea9d93990f 100644 --- a/SQLite.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SQLite.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS).sql index 28e381e00c62..b6cab137533e 100644 --- a/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SQLite.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS).sql index cd19e9385d17..f31152dafc76 100644 --- a/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SQLite.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SQLite.MS/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS).sql b/SQLite.MS/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS).sql index 2994c4425239..cfff06ca2659 100644 --- a/SQLite.MS/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS).sql +++ b/SQLite.MS/Tests/UserTests/Test4415/Test4415Tests/Tests.UserTests.Test4415.Test4415Tests.TestIssue4415_Test1(SQLite.MS).sql @@ -13,13 +13,13 @@ WHERE FROM ( SELECT - MAX([x_1].[LanguageID]) as [MAX_1] + MAX([x_1].[LanguageID]) as [Max_1] FROM [Common_Language] [x_1] GROUP BY [x_1].[Name] ) [t1] WHERE - [x].[LanguageID] = [t1].[MAX_1] OR [x].[LanguageID] IS NULL AND [t1].[MAX_1] IS NULL + [x].[LanguageID] = [t1].[Max_1] OR [x].[LanguageID] IS NULL AND [t1].[Max_1] IS NULL ) diff --git a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS).sql index 4f581a26e4dd..c5b455e93898 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SQLite.MS).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS).sql b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS).sql index 4f581a26e4dd..c5b455e93898 100644 --- a/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS).sql +++ b/SQLite.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SQLite.MS).sql @@ -10,9 +10,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 AND [Parent].[ParentID] = [b].[ParentID] diff --git a/SapHana.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..258916018ba1 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SapHana.Odbc.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + MIN("t1"."ParentID") +FROM + "Parent" "t1" +WHERE + "t1"."ParentID" < 0 + diff --git a/SapHana.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..06e82621a32b --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SapHana.Odbc.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" "p" + diff --git a/SapHana.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc.LinqService).sql index 3ec60bcf1bb2..002c2da8cb69 100644 --- a/SapHana.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ "p"."ParentID", "p"."Value1", - "t1"."COUNT_1" + "t1"."Count_1" FROM ( SELECT /* Inline */ "c_1"."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "c_1" GROUP BY diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc.LinqService).sql index ce56525aeb30..ccf85b570ec0 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY "tt"."Key_1" HAVING - SUM("tt"."ID") <> 0 + SUM("tt"."ID") <> 0 OR SUM("tt"."ID") IS NULL diff --git a/SapHana.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc.LinqService).sql index 7eb0d8d37c41..92da8718f58f 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "p"."ID" + CAST(CAST("p"."ID" AS TinyInt) AS NVarChar(3)) FROM "LinqDataTypes" "p" WHERE diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc.LinqService).sql index 532b3473359b..e237cb35c101 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc.LinqService).sql @@ -11,7 +11,7 @@ FROM "Child" "g_1" GROUP BY "g_1"."ParentID" - ) "g_2" + ) "t1" WHERE - "g_2"."ParentID" > 2 + "t1"."ParentID" > 2 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc.LinqService).sql index ac959291f134..a3f1b50c5c2c 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" "p" - INNER JOIN "Parent" "a_Parent" ON "p"."ParentID" = "a_Parent"."ParentID" + "Child" "ch" + INNER JOIN "Parent" "a_Parent" ON "ch"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" "p" - INNER JOIN "Parent" "a_Parent" ON "p"."ParentID" = "a_Parent"."ParentID" + "Child" "ch" + INNER JOIN "Parent" "a_Parent" ON "ch"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc.LinqService).sql index a12729943c86..90fe97f2c7c6 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" "p" - INNER JOIN "Parent" "a_Parent" ON "p"."ParentID" = "a_Parent"."ParentID" + "Child" "ch" + INNER JOIN "Parent" "a_Parent" ON "ch"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc.LinqService).sql index e40c3f1619e0..9692f031b5d2 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc.LinqService).sql @@ -2,22 +2,22 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "g_2"."MAX_1", - "g_2"."COUNT_1" + 1, - "g_2"."COUNT_1", - "g_2"."COUNT_2" + "g_2"."Max_1", + "g_2"."Count_1" + 1, + "g_2"."Count_1", + "g_2"."Count_2" FROM ( SELECT - MAX("g_1"."ChildID") as "MAX_1", + MAX("g_1"."ChildID") as "Max_1", COUNT(CASE WHEN "g_1"."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN "g_1"."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" "g_1" GROUP BY diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc.LinqService).sql index e40c3f1619e0..9692f031b5d2 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc.LinqService).sql @@ -2,22 +2,22 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "g_2"."MAX_1", - "g_2"."COUNT_1" + 1, - "g_2"."COUNT_1", - "g_2"."COUNT_2" + "g_2"."Max_1", + "g_2"."Count_1" + 1, + "g_2"."Count_1", + "g_2"."Count_2" FROM ( SELECT - MAX("g_1"."ChildID") as "MAX_1", + MAX("g_1"."ChildID") as "Max_1", COUNT(CASE WHEN "g_1"."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN "g_1"."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" "g_1" GROUP BY diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc.LinqService).sql index ce409d0f1679..d2d3c5aa15a0 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN "g_1"."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."COUNT_1" > 2 OR "g_2"."Key_1" > 2 + "g_2"."Count_1" > 2 OR "g_2"."Key_1" > 2 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc.LinqService).sql index 33b9a6cb8702..68e57cac1b5f 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT "g_1"."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."COUNT_1" > 2 AND "g_2"."Key_1" < 5 + "g_2"."Count_1" > 2 AND "g_2"."Key_1" < 5 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc.LinqService).sql index ad45145cf8c7..ce913d7732ea 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT "g_1"."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."COUNT_1" > 3 OR "g_2"."Key_1" = 1 + "g_2"."Count_1" > 3 OR "g_2"."Key_1" = 1 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc.LinqService).sql index d1a05cc28199..aaf24a221dc8 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t2"."COUNT_1" + "t2"."COUNT_1" + "t2"."Count_1" + "t2"."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" "c_1" WHERE "t1"."ParentID" = "c_1"."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" "t1" ) "t2" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc.LinqService).sql index 1dfded496080..a6d95f7b445d 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children_1" WHERE - "p"."ParentID" = "c_1"."ParentID" + "p"."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc.LinqService).sql index 1dfded496080..a6d95f7b445d 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children_1" WHERE - "p"."ParentID" = "c_1"."ParentID" + "p"."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/SapHana.Odbc.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..d9e93bc5492b --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc.LinqService).sql index f8473c9d1453..4335eb6eb514 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc.LinqService).sql @@ -16,10 +16,10 @@ FROM "ItemValue" "a_Values" WHERE "x"."Id" = "a_Values"."ItemId" - ) as "SUM_1" + ) as "Sum_1" FROM "Item" "x" ) "x_1" ORDER BY - "x_1"."SUM_1" + "x_1"."Sum_1" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc.LinqService).sql index db6b1f522e7d..1ceb2d0c9eef 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc.LinqService).sql @@ -36,10 +36,10 @@ FROM "ItemValue" "a_Values" WHERE "x"."Id" = "a_Values"."ItemId" - ) as "SUM_1" + ) as "Sum_1" FROM "Item" "x" ) "x_1" ORDER BY - "x_1"."SUM_1" + "x_1"."Sum_1" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc.LinqService).sql index 6f2406fdeb32..f3caeacf326b 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc.LinqService).sql @@ -36,10 +36,10 @@ FROM "ItemValue" "a_Values" WHERE "x"."Id" = "a_Values"."ItemId" - ) as "SUM_1" + ) as "Sum_1" FROM "Item" "x" ) "x_1" ORDER BY - Coalesce("x_1"."SUM_1", 0) + Coalesce("x_1"."Sum_1", 0) diff --git a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc.LinqService).sql index d64cc5517e99..e6622030c27e 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc.LinqService).sql @@ -2,13 +2,13 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t3"."SUM_1", - "t6"."COUNT_1" + "t3"."Sum_1", + "t6"."Count_1" FROM "MasterClass" "m_1" LEFT JOIN LATERAL ( SELECT - SUM("t2"."DetailId") as "SUM_1" + SUM("t2"."DetailId") as "Sum_1" FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) "t3" ON 1=1 LEFT JOIN LATERAL ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc.LinqService).sql index 733fb8a3d150..fa2c9d25544e 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc.LinqService).sql @@ -2,12 +2,12 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t3"."AVG_1" + "t3"."Average" FROM "MasterClass" "m_1" LEFT JOIN LATERAL ( SELECT - AVG(CAST("t2"."DetailId" AS Double)) as "AVG_1" + AVG(CAST("t2"."DetailId" AS Double)) as "Average" FROM ( SELECT diff --git a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc.LinqService).sql index e88b3304021e..514a8024b1a1 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > 0 + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" "p" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc.LinqService).sql index ec5fb7dcccc6..fea172609ad6 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > 1 + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" "p" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc.LinqService).sql index dda95a9732fd..1efaebee61cc 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > ? + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > ? ) + 2 FROM "Parent" "p" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc.LinqService).sql index 601b0b8a4b6d..403603a9f699 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > ? + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > ? ) + 4 FROM "Parent" "p" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc.LinqService).sql index d29c42ccc3f1..7adabf0cf8ef 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc.LinqService).sql @@ -2,93 +2,41 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t1"."Key_1", - "t1"."COUNT_1", - "t1"."COUNT_2", - "t1"."COUNT_3", - "t1"."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "x"."DataValue" - FROM - "AggregationData" "x" - WHERE - "x"."DataValue" IS NOT NULL AND "t1"."Key_1" = "x"."GroupId" - ) "x_1" - WHERE - MOD("x_1"."DataValue", 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "t_1"."DataValue" - FROM - "AggregationData" "t_1" - WHERE - "t_1"."DataValue" IS NOT NULL AND "t1"."Key_1" = "t_1"."GroupId" AND - MOD("t_1"."DataValue", 2) = 0 - ) "t2" - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "x_2"."DataValue" - FROM - "AggregationData" "x_2" - WHERE - "x_2"."DataValue" IS NOT NULL AND "t1"."Key_1" = "x_2"."GroupId" AND - MOD("x_2"."DataValue", 2) = 0 - ) "x_3" - WHERE - MOD("x_3"."DataValue", 2) = 0 - ), - "t1"."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "t_2"."DataValue" - FROM - "AggregationData" "t_2" - WHERE - "t_2"."DataValue" IS NOT NULL AND "t1"."Key_1" = "t_2"."GroupId" AND - MOD("t_2"."DataValue", 2) = 0 - ) "t3" - ) + "t"."GroupId", + COUNT(*), + COUNT(CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT "t"."DataValue"), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(DISTINCT "t"."DataValue") FROM - ( - SELECT - "t"."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN MOD("t"."DataValue", 2) = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT "t"."DataValue") as "COUNT_4", - COUNT(CASE - WHEN MOD("t"."DataValue", 2) = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" "t" - WHERE - "t"."DataValue" IS NOT NULL - GROUP BY - "t"."GroupId" - ) "t1" + "AggregationData" "t" +WHERE + "t"."DataValue" IS NOT NULL +GROUP BY + "t"."GroupId" BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) diff --git a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc.LinqService).sql index 163d9b14640b..d38afabe42ae 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" "g_1" @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) "g_2" WHERE - "g_2"."COUNT_1" > 2 AND "g_2"."ParentID" <> 1 + "g_2"."Count_1" > 2 AND "g_2"."ParentID" <> 1 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc.LinqService).sql index 5bd05dd408e9..732316b85fbf 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc.LinqService).sql @@ -2,23 +2,23 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "g_2"."MIN_2" + "g_2"."Min_2" FROM ( SELECT MIN(CASE WHEN "g_1"."ParentID" > 2 THEN "g_1"."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN "g_1"."ParentID" > 2 THEN "g_1"."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."MIN_1" IS NOT NULL + "g_2"."Min_1" IS NOT NULL diff --git a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc.LinqService).sql index c184f0d8c234..7cf0162729ed 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "g_2"."MIN_1" + "g_2"."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN "g_1"."ParentID" > 2 THEN "g_1"."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" "g_1" GROUP BY diff --git a/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc.LinqService).sql index 375880d3d013..55b51dd4f486 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc.LinqService).sql @@ -49,14 +49,14 @@ FROM "trade_2"."DealId" as "cond_1", "trade_2"."ParcelId", "trade_2"."CounterParty", - Coalesce("t1"."MAX_1", "t1"."CreationDate") as "LastUpdate" + "t1"."LastUpdate" FROM ( SELECT "al_group_2"."AlertKey", "al_group_2"."AlertCode", "al_group_2"."CreationDate", - MAX("au_1"."TransactionDate") as "MAX_1" + Coalesce(MAX("au_1"."TransactionDate"), "al_group_2"."CreationDate") as "LastUpdate" FROM "Alert" "al_group_2" LEFT JOIN "AuditAlert" "au_1" ON "au_1"."AlertKey" = "al_group_2"."AlertKey" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc.LinqService).sql index c5ca9be3287f..479918684023 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc.LinqService).sql @@ -49,14 +49,14 @@ FROM "trade_2"."DealId" as "cond_1", "trade_2"."ParcelId", "trade_2"."CounterParty", - Coalesce("t1"."MAX_1", "t1"."CreationDate") as "LastUpdate" + "t1"."LastUpdate" FROM ( SELECT "al_group_2"."AlertCode", "al_group_2"."AlertKey", "al_group_2"."CreationDate", - MAX("au_1"."TransactionDate") as "MAX_1" + Coalesce(MAX("au_1"."TransactionDate"), "al_group_2"."CreationDate") as "LastUpdate" FROM "Alert" "al_group_2" LEFT JOIN "AuditAlert" "au_1" ON "au_1"."AlertKey" = "al_group_2"."AlertKey" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc.LinqService).sql index 9f5dcffdfbb6..b4677923b280 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc.LinqService).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN "p"."MoneyValue" - FLOOR("p"."MoneyValue") = 0.5 AND MOD(FLOOR("p"."MoneyValue"), 2) = 0 + THEN FLOOR("p"."MoneyValue") + ELSE ROUND("p"."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN "t"."MoneyValue" - FLOOR("t"."MoneyValue") = 0.5 AND MOD(FLOOR("t"."MoneyValue"), 2) = 0 - THEN FLOOR("t"."MoneyValue") - ELSE ROUND("t"."MoneyValue", 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc.LinqService).sql index 39bc159a5ba3..e8fba366e5ff 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc.LinqService).sql index cd2455862e71..e776d9796a38 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc.LinqService).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) * 2 = ROUND(CAST("p"."MoneyValue" AS Double) * 2, 1) AND CAST("p"."MoneyValue" AS Double) <> ROUND(CAST("p"."MoneyValue" AS Double), 1) + THEN ROUND(CAST("p"."MoneyValue" AS Double) / 2, 1) * 2 + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 1) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) * 2 = ROUND(CAST("t"."MoneyValue" AS Double) * 2, 1) AND CAST("t"."MoneyValue" AS Double) <> ROUND(CAST("t"."MoneyValue" AS Double), 1) - THEN ROUND(CAST("t"."MoneyValue" AS Double) / 2, 1) * 2 - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 1) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,1).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,1).sql index bd8b38b7a204..d9c8324dbd86 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,1).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT - ROUND("p"."MoneyValue", 1) as "c1", - "p"."MoneyValue" + ROUND("p"."MoneyValue", 1) as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,2).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,2).sql index bd8b38b7a204..d9c8324dbd86 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,2).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT - ROUND("p"."MoneyValue", 1) as "c1", - "p"."MoneyValue" + ROUND("p"."MoneyValue", 1) as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,1).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,1).sql index 39bc159a5ba3..e8fba366e5ff 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,1).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,2).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,2).sql index 39bc159a5ba3..e8fba366e5ff 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,2).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc.LinqService).sql index 80946c306600..4c6e44b22283 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc.LinqService).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) - FLOOR(CAST("p"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("p"."MoneyValue" AS Double)), 2) = 0 + THEN FLOOR(CAST("p"."MoneyValue" AS Double)) + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) - FLOOR(CAST("t"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("t"."MoneyValue" AS Double)), 2) = 0 - THEN FLOOR(CAST("t"."MoneyValue" AS Double)) - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc.LinqService).sql index 39bc159a5ba3..e8fba366e5ff 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc.LinqService).sql index cd2455862e71..e776d9796a38 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc.LinqService).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) * 2 = ROUND(CAST("p"."MoneyValue" AS Double) * 2, 1) AND CAST("p"."MoneyValue" AS Double) <> ROUND(CAST("p"."MoneyValue" AS Double), 1) + THEN ROUND(CAST("p"."MoneyValue" AS Double) / 2, 1) * 2 + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 1) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) * 2 = ROUND(CAST("t"."MoneyValue" AS Double) * 2, 1) AND CAST("t"."MoneyValue" AS Double) <> ROUND(CAST("t"."MoneyValue" AS Double), 1) - THEN ROUND(CAST("t"."MoneyValue" AS Double) / 2, 1) * 2 - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 1) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc.LinqService).sql index 643afde8f2d6..85ca42ac43f0 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + ROUND("p"."MoneyValue") as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - ROUND("t"."MoneyValue") <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc.LinqService).sql index 73438c201e54..a50bdfb07833 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + ROUND(CAST("p"."MoneyValue" AS Double)) as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - ROUND(CAST("t"."MoneyValue" AS Double)) <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc.LinqService).sql index 9f5dcffdfbb6..b4677923b280 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc.LinqService).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN "p"."MoneyValue" - FLOOR("p"."MoneyValue") = 0.5 AND MOD(FLOOR("p"."MoneyValue"), 2) = 0 + THEN FLOOR("p"."MoneyValue") + ELSE ROUND("p"."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN "t"."MoneyValue" - FLOOR("t"."MoneyValue") = 0.5 AND MOD(FLOOR("t"."MoneyValue"), 2) = 0 - THEN FLOOR("t"."MoneyValue") - ELSE ROUND("t"."MoneyValue", 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc.LinqService).sql index 80946c306600..4c6e44b22283 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc.LinqService).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) - FLOOR(CAST("p"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("p"."MoneyValue" AS Double)), 2) = 0 + THEN FLOOR(CAST("p"."MoneyValue" AS Double)) + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) - FLOOR(CAST("t"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("t"."MoneyValue" AS Double)), 2) = 0 - THEN FLOOR(CAST("t"."MoneyValue" AS Double)) - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc.LinqService).sql index c435f156f6a4..c42ae0bf05bc 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc.LinqService).sql @@ -2,9 +2,14 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + ROUND("p"."MoneyValue", 1) as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - ROUND("t"."MoneyValue", 1) <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc.LinqService).sql index 41ee32fb81e4..f436a984539b 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 2 + "s"."Int" = 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 2 + "s"."Int" <> 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 4 + "s"."Int" = 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 4 + "s"."Int" <> 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NULL + "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NOT NULL + "s"."NullableInt" IS NOT NULL diff --git a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc.LinqService).sql index 41ee32fb81e4..f436a984539b 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 2 + "s"."Int" = 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 2 + "s"."Int" <> 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 4 + "s"."Int" = 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 4 + "s"."Int" <> 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NULL + "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NOT NULL + "s"."NullableInt" IS NOT NULL diff --git a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc.LinqService).sql index 78aeeaaf03bf..2f7488915882 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'abc' OR "x"."String" IS NULL + "s"."String" = 'abc' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'abc' OR "x"."String" IS NULL) + NOT ("s"."String" = 'abc' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'xyz' OR "x"."String" IS NULL + "s"."String" = 'xyz' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'xyz' OR "x"."String" IS NULL) + NOT ("s"."String" = 'xyz' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NULL + "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NOT NULL + "s"."String" IS NOT NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NULL + "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NOT NULL + "s"."NullableString" IS NOT NULL diff --git a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc.LinqService).sql index 78aeeaaf03bf..2f7488915882 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'abc' OR "x"."String" IS NULL + "s"."String" = 'abc' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'abc' OR "x"."String" IS NULL) + NOT ("s"."String" = 'abc' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'xyz' OR "x"."String" IS NULL + "s"."String" = 'xyz' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'xyz' OR "x"."String" IS NULL) + NOT ("s"."String" = 'xyz' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NULL + "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NOT NULL + "s"."String" IS NOT NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NULL + "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NOT NULL + "s"."NullableString" IS NOT NULL diff --git a/SapHana.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc.LinqService).sql index 2ca84b7d5efa..0f64b87e8688 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc.LinqService).sql @@ -16,12 +16,12 @@ FROM "Child" "a_Children" WHERE "p"."ParentID" = "a_Children"."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" "p" ) "t1" INNER JOIN "Parent" "pp" ON "t1"."Value1" = "pp"."Value1" ORDER BY "pp"."ParentID", - "t1"."COUNT_1" + "t1"."Count_1" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc.LinqService).sql index c87d53ff8d2d..a0a0e29cee39 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), "x"."Key_1", "x"."Count_1", - "x"."MAX_1" + "x"."Max_1" FROM ( SELECT "summary"."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX("summary"."FirstName") as "MAX_1" + MAX("summary"."FirstName") as "Max_1" FROM "Person" "summary" GROUP BY diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..90abff3ed749 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SapHana.Odbc.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + Coalesce("t"."Value2", '') +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + Coalesce("t"."Value3", '') +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + SUBSTRING(Coalesce(' -> ' || "t"."Value3", '') || Coalesce(' -> ' || "t"."Value1", '') || Coalesce(' -> ' || "t"."Value2", ''), 5) +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + SUBSTRING(Coalesce(' -> ' || "t"."Value3", '') || Coalesce(' -> ' || "t"."Value3", ''), 5) +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..ff91efb18ac6 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SapHana.Odbc.LinqService).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + Coalesce("t"."NullableValue", '') || ', ' || "t"."NotNullableValue" || ', ' || Coalesce("t"."VarcharValue", '') || ', ' || Coalesce("t"."NVarcharValue", ''), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t2"."item_1", ''), ', ' ORDER BY "t2"."item_1" NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t1"."item" as "item_1" + FROM + ( + SELECT "t"."NotNullableValue" AS "item" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NVarcharValue" FROM DUMMY) "t1" + WHERE + "t1"."item" IS NOT NULL + ) "t2" + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t4"."item_1", ''), ', ' ORDER BY CASE + WHEN "t4"."item_1" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, "t4"."item_1" NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t3"."item" as "item_1" + FROM + ( + SELECT "t"."NotNullableValue" AS "item" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NVarcharValue" FROM DUMMY) "t3" + WHERE + "t3"."item" <> 'A' OR "t3"."item" IS NULL + ) "t4" + ) +FROM + "SampleClass" "t" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..5ab5b092d112 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SapHana.Odbc.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + SUBSTRING(Coalesce(', ' || "t"."NullableValue", '') || ', ' || "t"."NotNullableValue" || Coalesce(', ' || "t"."VarcharValue", '') || Coalesce(', ' || "t"."NVarcharValue", ''), 3), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t2"."item_1", ''), ', ' ORDER BY "t2"."item_1" NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t1"."item" as "item_1" + FROM + ( + SELECT "t"."NullableValue" AS "item" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."VarcharValue" FROM DUMMY + UNION ALL + SELECT "t"."NVarcharValue" FROM DUMMY) "t1" + WHERE + "t1"."item" IS NOT NULL + ) "t2" + ) +FROM + "SampleClass" "t" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..21bac5d89465 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SapHana.Odbc.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "x"."c1" +FROM + ( + SELECT + SUBSTRING(Coalesce(', ' || CASE + WHEN "t"."NullableValue" LIKE '%A%' ESCAPE '~' THEN "t"."NullableValue" + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN "t"."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN "t"."NotNullableValue" + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN "t"."VarcharValue" LIKE '%A%' ESCAPE '~' THEN "t"."VarcharValue" + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN "t"."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN "t"."NVarcharValue" + ELSE NULL + END, ''), 3) as "c1" + FROM + "SampleClass" "t" + ) "x" +WHERE + LTRIM("x"."c1", ' + …             

  ') <> '' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..bf7bc1acc611 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SapHana.Odbc.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce("t1"."NullableValue", ''), ', ' ORDER BY "t1"."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..b2a9f465b6e1 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SapHana.Odbc.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + Coalesce(STRING_AGG("t1"."NullableValue", ', ' ORDER BY "t1"."NotNullableValue"), '') +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..b2a9f465b6e1 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SapHana.Odbc.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + Coalesce(STRING_AGG("t1"."NullableValue", ', ' ORDER BY "t1"."NotNullableValue"), '') +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..f732719f1fd5 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SapHana.Odbc.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "g_1"."Id", + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', '), + STRING_AGG("g_1"."NotNullableValue", ', ') +FROM + "SampleClass" "g_1" +GROUP BY + "g_1"."Id" +ORDER BY + "g_1"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..c8b762fd28ab --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SapHana.Odbc.LinqService).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t5"."Key_1", + "t2"."Join_1", + "t4"."Join_1" +FROM + ( + SELECT + "g_1"."Id" as "Key_1" + FROM + "SampleClass" "g_1" + GROUP BY + "g_1"."Id" + ) "t5" + LEFT JOIN LATERAL ( + SELECT + Coalesce(STRING_AGG(Coalesce("t1"."NullableValue", ''), ', '), '') as "Join_1" + FROM + ( + SELECT + "x"."NullableValue" + FROM + "SampleClass" "x" + WHERE + "t5"."Key_1" = "x"."Id" + ORDER BY + "x"."NotNullableValue" + LIMIT 2 + ) "t1" + ) "t2" ON 1=1 + LEFT JOIN LATERAL ( + SELECT + Coalesce(STRING_AGG("t3"."NotNullableValue", ', '), '') as "Join_1" + FROM + ( + SELECT + "x_1"."NotNullableValue" + FROM + "SampleClass" "x_1" + WHERE + "t5"."Key_1" = "x_1"."Id" + ORDER BY + "x_1"."NotNullableValue" + LIMIT 2 + ) "t3" + ) "t4" ON 1=1 +ORDER BY + "t5"."Key_1" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..82870a754fa6 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SapHana.Odbc.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "g_1"."Id", + Coalesce(STRING_AGG("g_1"."NullableValue", ', ' ORDER BY "g_1"."NullableValue", "g_1"."Id"), ''), + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', ' ORDER BY "g_1"."NullableValue" NULLS FIRST) +FROM + "SampleClass" "g_1" +GROUP BY + "g_1"."Id" +ORDER BY + "g_1"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..6ddaaee598e8 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SapHana.Odbc.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "g_1"."Id", + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', ' ORDER BY "g_1"."NotNullableValue" NULLS FIRST, "g_1"."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN "g_1"."NullableValue" <> '' THEN "g_1"."NullableValue" + ELSE NULL + END, ', ' ORDER BY "g_1"."NotNullableValue", "g_1"."NullableValue" DESC), ''), + STRING_AGG("g_1"."NotNullableValue", ', ' ORDER BY "g_1"."NotNullableValue" DESC NULLS FIRST, "g_1"."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', ' ORDER BY "g_1"."NotNullableValue" DESC NULLS FIRST), + STRING_AGG("g_1"."NotNullableValue", ', ' ORDER BY "g_1"."NotNullableValue" DESC NULLS FIRST), + STRING_AGG("g_1"."NotNullableValue", ', ' ORDER BY CASE + WHEN "g_1"."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, "g_1"."NotNullableValue" DESC NULLS FIRST, "g_1"."NullableValue" NULLS FIRST) +FROM + "SampleClass" "g_1" +GROUP BY + "g_1"."Id" +ORDER BY + "g_1"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SapHana.Odbc.LinqService).sql new file mode 100644 index 000000000000..6e4716f151f1 --- /dev/null +++ b/SapHana.Odbc.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SapHana.Odbc.LinqService).sql @@ -0,0 +1,94 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t2"."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + "t"."NullableValue" + FROM + "SampleClass" "t" + WHERE + "t1"."Key_1" = "t"."Id" + ) "t2" + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t3"."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + "t_1"."NullableValue" + FROM + "SampleClass" "t_1" + WHERE + "t1"."Key_1" = "t_1"."Id" AND "t_1"."NullableValue" IS NOT NULL + ) "t3" + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t4"."NullableValue", ''), ', ' ORDER BY "t4"."NullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t_2"."NullableValue" + FROM + "SampleClass" "t_2" + WHERE + "t1"."Key_1" = "t_2"."Id" AND "t_2"."NullableValue" IS NOT NULL + ) "t4" + ), + ( + SELECT + Coalesce(STRING_AGG("t5"."NotNullableValue", ', '), '') + FROM + ( + SELECT DISTINCT + "t_3"."NotNullableValue" + FROM + "SampleClass" "t_3" + WHERE + "t1"."Key_1" = "t_3"."Id" + ) "t5" + ), + ( + SELECT + Coalesce(STRING_AGG("t6"."NotNullableValue", ', ' ORDER BY "t6"."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t_4"."NotNullableValue" + FROM + "SampleClass" "t_4" + WHERE + "t1"."Key_1" = "t_4"."Id" + ) "t6" + ) +FROM + ( + SELECT + "g_1"."Id" as "Key_1" + FROM + "SampleClass" "g_1" + GROUP BY + "g_1"."Id" + ) "t1" +ORDER BY + "t1"."Key_1" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc.LinqService).sql index ba2d7fd6d060..fc6d6b2128d3 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc.LinqService).sql @@ -7,30 +7,25 @@ SELECT "d"."Amount", "d"."Currency" FROM - ( - SELECT DISTINCT - "x"."Id" + "TransactionEntity" "m_1" + INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" "x" + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - "x"."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - "t1"."item" - FROM - ( - SELECT 'A' AS "item" FROM DUMMY - UNION ALL - SELECT 'B' FROM DUMMY) "t1" - ) - ) "m_1" - INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" + "m_1"."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + "t1"."item" + FROM + ( + SELECT 'A' AS "item" FROM DUMMY + UNION ALL + SELECT 'B' FROM DUMMY) "t1" + ) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) diff --git a/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc.LinqService).sql index 6602469162c8..6fc45c6360a4 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc.LinqService).sql @@ -7,30 +7,25 @@ SELECT "d"."Amount", "d"."Currency" FROM - ( - SELECT DISTINCT - "x"."Id" + "TransactionEntity" "m_1" + INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" "x" + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - "x"."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - "t1"."item" - FROM - ( - SELECT 'A' AS "item" FROM DUMMY - UNION ALL - SELECT 'B' FROM DUMMY) "t1" - ) - ) "m_1" - INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" + "m_1"."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + "t1"."item" + FROM + ( + SELECT 'A' AS "item" FROM DUMMY + UNION ALL + SELECT 'B' FROM DUMMY) "t1" + ) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) diff --git a/SapHana.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc.LinqService).sql index 9966c7332d3e..747764b00fb9 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc.LinqService).sql @@ -2,12 +2,12 @@ -- SapHana.Odbc SapHanaOdbc (asynchronously) SELECT - "g_1"."COUNT_1" + "g_1"."Count_1" FROM ( SELECT "c_1"."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "c_1" GROUP BY @@ -16,5 +16,5 @@ FROM "c_1"."ParentID" > 1 ) "g_1" WHERE - "g_1"."Key_1" > 1 AND "g_1"."COUNT_1" > 1 + "g_1"."Key_1" > 1 AND "g_1"."Count_1" > 1 diff --git a/SapHana.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SapHana.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 9c5fa07c8b80..1fb5e9a29b2b 100644 --- a/SapHana.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SapHana.Odbc.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT "d"."ValB", "d"."ValInt" FROM - ( - SELECT DISTINCT - "l1"."ID", - "l1"."ValS" + "Issue3757Level1" "m_1" + INNER JOIN "Issue3757Level2" "d" ON "m_1"."ID" = "d"."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" "l1" + "Issue3757Level2" "c_1" WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" "c_1" - WHERE - "l1"."ID" = "c_1"."ParentId" AND "l1"."ValS" LIKE ? ESCAPE '~' AND - "l1"."ValS" IS NOT NULL - ) - ) "m_1" - INNER JOIN "Issue3757Level2" "d" ON "m_1"."ID" = "d"."ParentId" + "m_1"."ID" = "c_1"."ParentId" AND "m_1"."ValS" LIKE ? ESCAPE '~' AND + "m_1"."ValS" IS NOT NULL + ) BeforeExecute -- SapHana.Odbc SapHanaOdbc (asynchronously) diff --git a/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc.LinqService).sql index d9fbdcf03442..556b4c989c3f 100644 --- a/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT "x_1"."ParentID", "x_1"."CountResult", - "x_1"."SUM_1" + "x_1"."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "od_1" WHERE "x"."ParentID" = "od_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" "x" ) "x_1" diff --git a/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc.LinqService).sql index 09391502e79b..67fc5cfba60d 100644 --- a/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT "x"."ParentID", "x"."CountResult", - "x"."SUM_1" + "x"."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE "o"."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" "o" ) "x" diff --git a/SapHana.Odbc.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc.LinqService).sql index 5b238ed927fc..2cfcccfbb8e4 100644 --- a/SapHana.Odbc.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc.LinqService).sql @@ -20,7 +20,7 @@ FROM "vpc"."CategoryId", "pop"."ProductId", COALESCE("pcc"."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE("vsp"."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE("vsp"."Quantity",0),0) as "Quantity" FROM "OrderPeriod" "op" INNER JOIN "ProductsPerOrderPeriod" "pop" ON "op"."Id" = "pop"."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT "agroup"."Id", "oi"."ProductId", - SUM(COALESCE("oi"."Quantity",0)) as "SUM_1" + SUM(COALESCE("oi"."Quantity",0)) as "Quantity" FROM "OrderPeriod" "agroup" LEFT JOIN "OrderHeader" "oh" ON "agroup"."Id" = "oh"."PeriodId" diff --git a/SapHana.Odbc.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc.LinqService).sql index 927fcd79d191..7c61d0b0d1c1 100644 --- a/SapHana.Odbc.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc.LinqService).sql @@ -3,7 +3,7 @@ SELECT ' ' || CAST(Coalesce("t1"."Value1", 0) AS NVarChar(11)), - "t1"."SUM_1", + "t1"."SubSum", CASE WHEN EXISTS( SELECT @@ -38,12 +38,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON "c_1"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = "f"."ParentID" AND ("a_Parent"."Value1" = "f"."Value1" OR "a_Parent"."Value1" IS NULL AND "f"."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", "f"."ParentID" FROM "Parent" "f" ) "t1" WHERE ' ' || CAST(Coalesce("t1"."Value1", 0) AS NVarChar(11)) LIKE '%1%' ESCAPE '~' AND - "t1"."SUM_1" > 0 + "t1"."SubSum" > 0 diff --git a/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc.LinqService).sql index c8d871b8c762..4ef98e6845de 100644 --- a/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc.LinqService).sql @@ -5,13 +5,13 @@ SELECT "p1"."ParentID", "p1"."Value1", "p2"."Key_1", - "p2"."SUM_1" + "p2"."Sum_1" FROM "Parent" "p1" INNER JOIN ( SELECT "g_1"."ParentID" as "Key_1", - SUM("g_1"."ParentID") as "SUM_1" + SUM("g_1"."ParentID") as "Sum_1" FROM "Parent" "g_1" WHERE diff --git a/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc.LinqService).sql index 972c15b5cd74..53c294c5c991 100644 --- a/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc.LinqService).sql @@ -3,14 +3,14 @@ SELECT "t1"."Key_1", - "t1"."SUM_1", + "t1"."Sum_1", "p2"."Key_1", "p2"."Sum_1" FROM ( SELECT "g_1"."ParentID" as "Key_1", - SUM("g_1"."ParentID") as "SUM_1" + SUM("g_1"."ParentID") as "Sum_1" FROM "Parent" "g_1" WHERE diff --git a/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc.LinqService).sql index 3161b114f936..f7e4f28402ea 100644 --- a/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc.LinqService).sql @@ -13,9 +13,9 @@ SET WHERE "b_1"."ChildID" = ( SELECT - MAX("b2_1"."ParentID") + MAX("t2"."ParentID") FROM - "Child" "b2_1" + "Child" "t2" ) AND "b_1"."ChildID" = -1 AND "Parent"."ParentID" = "w_1"."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE "b"."ChildID" = ( SELECT - MAX("b2"."ParentID") + MAX("t1"."ParentID") FROM - "Child" "b2" + "Child" "t1" ) AND "b"."ChildID" = -1 AND "Parent"."ParentID" = "w"."ParentID" AND diff --git a/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc.LinqService).sql index 3161b114f936..f7e4f28402ea 100644 --- a/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc.LinqService).sql @@ -13,9 +13,9 @@ SET WHERE "b_1"."ChildID" = ( SELECT - MAX("b2_1"."ParentID") + MAX("t2"."ParentID") FROM - "Child" "b2_1" + "Child" "t2" ) AND "b_1"."ChildID" = -1 AND "Parent"."ParentID" = "w_1"."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE "b"."ChildID" = ( SELECT - MAX("b2"."ParentID") + MAX("t1"."ParentID") FROM - "Child" "b2" + "Child" "t1" ) AND "b"."ChildID" = -1 AND "Parent"."ParentID" = "w"."ParentID" AND diff --git a/SapHana.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SapHana.Odbc).sql new file mode 100644 index 000000000000..3c4931057091 --- /dev/null +++ b/SapHana.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SapHana.Odbc).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + MIN("t1"."ParentID") +FROM + "Parent" "t1" +WHERE + "t1"."ParentID" < 0 + diff --git a/SapHana.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SapHana.Odbc).sql new file mode 100644 index 000000000000..657f5c0f264f --- /dev/null +++ b/SapHana.Odbc/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SapHana.Odbc).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + ( + SELECT + MIN("a_Children"."ParentID") + FROM + "Child" "a_Children" + WHERE + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ParentID" < 0 + ) +FROM + "Parent" "p" + diff --git a/SapHana.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc).sql index f1ff0b5373c6..1a6896a29589 100644 --- a/SapHana.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SapHana.Odbc).sql @@ -4,12 +4,12 @@ SELECT /* Main */ "p"."ParentID", "p"."Value1", - "t1"."COUNT_1" + "t1"."Count_1" FROM ( SELECT /* Inline */ "c_1"."ParentID", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "c_1" GROUP BY diff --git a/SapHana.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc).sql index d3f94144a359..0e0db1383582 100644 --- a/SapHana.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SapHana.Odbc).sql @@ -25,5 +25,5 @@ FROM GROUP BY "tt"."Key_1" HAVING - SUM("tt"."ID") <> 0 + SUM("tt"."ID") <> 0 OR SUM("tt"."ID") IS NULL diff --git a/SapHana.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc).sql index c06dc1bc2173..fc247fe5f9b4 100644 --- a/SapHana.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SapHana.Odbc).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "p"."ID" + CAST(CAST("p"."ID" AS TinyInt) AS NVarChar(3)) FROM "LinqDataTypes" "p" WHERE diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc).sql index fdab61e5aff9..de24d73b5848 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SapHana.Odbc).sql @@ -11,7 +11,7 @@ FROM "Child" "g_1" GROUP BY "g_1"."ParentID" - ) "g_2" + ) "t1" WHERE - "g_2"."ParentID" > 2 + "t1"."ParentID" > 2 diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc).sql index 575e397d06ab..c42047b0af96 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SapHana.Odbc).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" "p" - INNER JOIN "Parent" "a_Parent" ON "p"."ParentID" = "a_Parent"."ParentID" + "Child" "ch" + INNER JOIN "Parent" "a_Parent" ON "ch"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - "Child" "p" - INNER JOIN "Parent" "a_Parent" ON "p"."ParentID" = "a_Parent"."ParentID" + "Child" "ch" + INNER JOIN "Parent" "a_Parent" ON "ch"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc).sql index fcd06bfaf687..462629dc781e 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SapHana.Odbc).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - "Child" "p" - INNER JOIN "Parent" "a_Parent" ON "p"."ParentID" = "a_Parent"."ParentID" + "Child" "ch" + INNER JOIN "Parent" "a_Parent" ON "ch"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = 1 diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc).sql index ca6ea6e45b08..8ec98ac4da4e 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SapHana.Odbc).sql @@ -2,22 +2,22 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "g_2"."MAX_1", - "g_2"."COUNT_1" + 1, - "g_2"."COUNT_1", - "g_2"."COUNT_2" + "g_2"."Max_1", + "g_2"."Count_1" + 1, + "g_2"."Count_1", + "g_2"."Count_2" FROM ( SELECT - MAX("g_1"."ChildID") as "MAX_1", + MAX("g_1"."ChildID") as "Max_1", COUNT(CASE WHEN "g_1"."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN "g_1"."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" "g_1" GROUP BY diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc).sql index ca6ea6e45b08..8ec98ac4da4e 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SapHana.Odbc).sql @@ -2,22 +2,22 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "g_2"."MAX_1", - "g_2"."COUNT_1" + 1, - "g_2"."COUNT_1", - "g_2"."COUNT_2" + "g_2"."Max_1", + "g_2"."Count_1" + 1, + "g_2"."Count_1", + "g_2"."Count_2" FROM ( SELECT - MAX("g_1"."ChildID") as "MAX_1", + MAX("g_1"."ChildID") as "Max_1", COUNT(CASE WHEN "g_1"."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1", + END) as "Count_1", COUNT(CASE WHEN "g_1"."ChildID" > 10 THEN 1 ELSE NULL - END) as "COUNT_2" + END) as "Count_2" FROM "Child" "g_1" GROUP BY diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc).sql index 2e0d11763528..9ce42a2c7c4a 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SapHana.Odbc).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN "g_1"."ChildID" > 20 THEN 1 ELSE NULL - END) as "COUNT_1" + END) as "Count_1" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."COUNT_1" > 2 OR "g_2"."Key_1" > 2 + "g_2"."Count_1" > 2 OR "g_2"."Key_1" > 2 diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc).sql index 0a40174354b0..4abd54df4978 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SapHana.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT "g_1"."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."COUNT_1" > 2 AND "g_2"."Key_1" < 5 + "g_2"."Count_1" > 2 AND "g_2"."Key_1" < 5 diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc).sql index 40747ade9ae7..f534f61c8df6 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SapHana.Odbc).sql @@ -7,12 +7,12 @@ FROM ( SELECT "g_1"."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."COUNT_1" > 3 OR "g_2"."Key_1" = 1 + "g_2"."Count_1" > 3 OR "g_2"."Key_1" = 1 diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc).sql index 69df21a1a451..3556d67317d8 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SapHana.Odbc).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t2"."COUNT_1" + "t2"."COUNT_1" + "t2"."Count_1" + "t2"."Count_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM "Child" "c_1" WHERE "t1"."ParentID" = "c_1"."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" "t1" ) "t2" diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc).sql index b12142e79b66..ca6983da7732 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SapHana.Odbc).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children_1" WHERE - "p"."ParentID" = "c_1"."ParentID" + "p"."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc).sql index b12142e79b66..ca6983da7732 100644 --- a/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SapHana.Odbc).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children_1" WHERE - "p"."ParentID" = "c_1"."ParentID" + "p"."ParentID" = "a_Children_1"."ParentID" ) END FROM diff --git a/SapHana.Odbc/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc).sql new file mode 100644 index 000000000000..c5c11cdbfe50 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SapHana.Odbc).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group_1", + "t1"."Date_1", + "t1"."Amount", + "t1"."IsActive" +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY "e"."Id", "e"."Name" ORDER BY "e"."Name", "e"."Date" DESC) as "RowNumber", + "e"."Name", + "e"."Date" as "Date_1", + "e"."Id", + "e"."Group" as "Group_1", + "e"."Amount", + "e"."IsActive" + FROM + "TestData" "e" + ) "t1" +WHERE + "t1"."RowNumber" = 1 +ORDER BY + "t1"."Name", + "t1"."Date_1" DESC + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."Name", + "t1"."Group", + "t1"."Date", + "t1"."Amount", + "t1"."IsActive" +FROM + "TestData" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc).sql index 55a7113cdd2e..0c61dd93e7e5 100644 --- a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SapHana.Odbc).sql @@ -16,10 +16,10 @@ FROM "ItemValue" "a_Values" WHERE "x"."Id" = "a_Values"."ItemId" - ) as "SUM_1" + ) as "Sum_1" FROM "Item" "x" ) "x_1" ORDER BY - "x_1"."SUM_1" + "x_1"."Sum_1" diff --git a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc).sql index 5178b0f4ee83..859c431341ad 100644 --- a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SapHana.Odbc).sql @@ -40,10 +40,10 @@ FROM "ItemValue" "a_Values" WHERE "x"."Id" = "a_Values"."ItemId" - ) as "SUM_1" + ) as "Sum_1" FROM "Item" "x" ) "x_1" ORDER BY - "x_1"."SUM_1" + "x_1"."Sum_1" diff --git a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc).sql index 56a258304ea3..3df0e762bc32 100644 --- a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SapHana.Odbc).sql @@ -40,10 +40,10 @@ FROM "ItemValue" "a_Values" WHERE "x"."Id" = "a_Values"."ItemId" - ) as "SUM_1" + ) as "Sum_1" FROM "Item" "x" ) "x_1" ORDER BY - Coalesce("x_1"."SUM_1", 0) + Coalesce("x_1"."Sum_1", 0) diff --git a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc).sql index d2e844a9332f..d35d10687433 100644 --- a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SapHana.Odbc).sql @@ -2,13 +2,13 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t3"."SUM_1", - "t6"."COUNT_1" + "t3"."Sum_1", + "t6"."Count_1" FROM "MasterClass" "m_1" LEFT JOIN LATERAL ( SELECT - SUM("t2"."DetailId") as "SUM_1" + SUM("t2"."DetailId") as "Sum_1" FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) "t3" ON 1=1 LEFT JOIN LATERAL ( SELECT - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM ( SELECT diff --git a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc).sql index 46e93721c824..fc75d7b76cdb 100644 --- a/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SapHana.Odbc).sql @@ -2,12 +2,12 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t3"."AVG_1" + "t3"."Average" FROM "MasterClass" "m_1" LEFT JOIN LATERAL ( SELECT - AVG(CAST("t2"."DetailId" AS Double)) as "AVG_1" + AVG(CAST("t2"."DetailId" AS Double)) as "Average" FROM ( SELECT diff --git a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc).sql index 1d3e6c13c123..f5b8d5a2913c 100644 --- a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SapHana.Odbc).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > 0 + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 0 ) FROM "Parent" "p" diff --git a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc).sql index bf8375ca9ec7..a9bf35596d47 100644 --- a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SapHana.Odbc).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > 1 + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > 1 ) FROM "Parent" "p" diff --git a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc).sql index 25a555cc9423..60ed19cd0e29 100644 --- a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SapHana.Odbc).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > ? + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > ? ) + 2 FROM "Parent" "p" diff --git a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc).sql index 88ccdce8ecbb..b22321774357 100644 --- a/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SapHana.Odbc).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - "Child" "c_1" + "Child" "a_Children" WHERE - "p"."ParentID" = "c_1"."ParentID" AND "c_1"."ChildID" > ? + "p"."ParentID" = "a_Children"."ParentID" AND "a_Children"."ChildID" > ? ) + 4 FROM "Parent" "p" diff --git a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc).sql index 170765c55c2b..e4381ddcac1a 100644 --- a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SapHana.Odbc).sql @@ -2,93 +2,41 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t1"."Key_1", - "t1"."COUNT_1", - "t1"."COUNT_2", - "t1"."COUNT_3", - "t1"."COUNT_4", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "x"."DataValue" - FROM - "AggregationData" "x" - WHERE - "x"."DataValue" IS NOT NULL AND "t1"."Key_1" = "x"."GroupId" - ) "x_1" - WHERE - MOD("x_1"."DataValue", 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "t_1"."DataValue" - FROM - "AggregationData" "t_1" - WHERE - "t_1"."DataValue" IS NOT NULL AND "t1"."Key_1" = "t_1"."GroupId" AND - MOD("t_1"."DataValue", 2) = 0 - ) "t2" - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "x_2"."DataValue" - FROM - "AggregationData" "x_2" - WHERE - "x_2"."DataValue" IS NOT NULL AND "t1"."Key_1" = "x_2"."GroupId" AND - MOD("x_2"."DataValue", 2) = 0 - ) "x_3" - WHERE - MOD("x_3"."DataValue", 2) = 0 - ), - "t1"."COUNT_5", - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - "t_2"."DataValue" - FROM - "AggregationData" "t_2" - WHERE - "t_2"."DataValue" IS NOT NULL AND "t1"."Key_1" = "t_2"."GroupId" AND - MOD("t_2"."DataValue", 2) = 0 - ) "t3" - ) + "t"."GroupId", + COUNT(*), + COUNT(CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT "t"."DataValue"), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN MOD("t"."DataValue", 2) = 0 THEN "t"."DataValue" + ELSE NULL + END), + COUNT(DISTINCT "t"."DataValue") FROM - ( - SELECT - "t"."GroupId" as "Key_1", - COUNT(*) as "COUNT_1", - COUNT(CASE - WHEN MOD("t"."DataValue", 2) = 0 THEN 1 - ELSE NULL - END) as "COUNT_2", - COUNT(*) as "COUNT_3", - COUNT(DISTINCT "t"."DataValue") as "COUNT_4", - COUNT(CASE - WHEN MOD("t"."DataValue", 2) = 0 THEN 1 - ELSE NULL - END) as "COUNT_5" - FROM - "AggregationData" "t" - WHERE - "t"."DataValue" IS NOT NULL - GROUP BY - "t"."GroupId" - ) "t1" + "AggregationData" "t" +WHERE + "t"."DataValue" IS NOT NULL +GROUP BY + "t"."GroupId" BeforeExecute -- SapHana.Odbc SapHanaOdbc diff --git a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc).sql index 6e9753454c9d..c5f17df88bc3 100644 --- a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SapHana.Odbc).sql @@ -7,7 +7,7 @@ FROM ( SELECT "a_Parent"."ParentID", - COUNT(*) as "COUNT_1", + COUNT(*) as "Count_1", "a_Parent"."Value1" FROM "GrandChild" "g_1" @@ -17,5 +17,5 @@ FROM "a_Parent"."Value1" ) "g_2" WHERE - "g_2"."COUNT_1" > 2 AND "g_2"."ParentID" <> 1 + "g_2"."Count_1" > 2 AND "g_2"."ParentID" <> 1 diff --git a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc).sql index 151053d09d5e..5c7ef68194b7 100644 --- a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SapHana.Odbc).sql @@ -2,23 +2,23 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "g_2"."MIN_2" + "g_2"."Min_2" FROM ( SELECT MIN(CASE WHEN "g_1"."ParentID" > 2 THEN "g_1"."ChildID" ELSE NULL - END) as "MIN_1", + END) as "Min_1", MIN(CASE WHEN "g_1"."ParentID" > 2 THEN "g_1"."ChildID" ELSE NULL - END) as "MIN_2" + END) as "Min_2" FROM "Child" "g_1" GROUP BY "g_1"."ParentID" ) "g_2" WHERE - "g_2"."MIN_1" IS NOT NULL + "g_2"."Min_1" IS NOT NULL diff --git a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc).sql index bbe9d8420909..f23a32b39ebe 100644 --- a/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SapHana.Odbc).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "g_2"."MIN_1" + "g_2"."Min_1" FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN "g_1"."ParentID" > 2 THEN "g_1"."ChildID" ELSE NULL - END) as "MIN_1" + END) as "Min_1" FROM "Child" "g_1" GROUP BY diff --git a/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc).sql index 5ee8f7c9f60d..24a5944fbea3 100644 --- a/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SapHana.Odbc).sql @@ -49,14 +49,14 @@ FROM "trade_2"."DealId" as "cond_1", "trade_2"."ParcelId", "trade_2"."CounterParty", - Coalesce("t1"."MAX_1", "t1"."CreationDate") as "LastUpdate" + "t1"."LastUpdate" FROM ( SELECT "al_group_2"."AlertKey", "al_group_2"."AlertCode", "al_group_2"."CreationDate", - MAX("au_1"."TransactionDate") as "MAX_1" + Coalesce(MAX("au_1"."TransactionDate"), "al_group_2"."CreationDate") as "LastUpdate" FROM "Alert" "al_group_2" LEFT JOIN "AuditAlert" "au_1" ON "au_1"."AlertKey" = "al_group_2"."AlertKey" diff --git a/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc).sql index 3d437172f358..151d7f53289f 100644 --- a/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SapHana.Odbc).sql @@ -49,14 +49,14 @@ FROM "trade_2"."DealId" as "cond_1", "trade_2"."ParcelId", "trade_2"."CounterParty", - Coalesce("t1"."MAX_1", "t1"."CreationDate") as "LastUpdate" + "t1"."LastUpdate" FROM ( SELECT "al_group_2"."AlertCode", "al_group_2"."AlertKey", "al_group_2"."CreationDate", - MAX("au_1"."TransactionDate") as "MAX_1" + Coalesce(MAX("au_1"."TransactionDate"), "al_group_2"."CreationDate") as "LastUpdate" FROM "Alert" "al_group_2" LEFT JOIN "AuditAlert" "au_1" ON "au_1"."AlertKey" = "al_group_2"."AlertKey" diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc).sql index 81cc22019642..c14354931b39 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SapHana.Odbc).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN "p"."MoneyValue" - FLOOR("p"."MoneyValue") = 0.5 AND MOD(FLOOR("p"."MoneyValue"), 2) = 0 + THEN FLOOR("p"."MoneyValue") + ELSE ROUND("p"."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN "t"."MoneyValue" - FLOOR("t"."MoneyValue") = 0.5 AND MOD(FLOOR("t"."MoneyValue"), 2) = 0 - THEN FLOOR("t"."MoneyValue") - ELSE ROUND("t"."MoneyValue", 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc).sql index 1629f3650011..635777945c40 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SapHana.Odbc).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc).sql index 2292ffd9be71..05773ccef9cc 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SapHana.Odbc).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) * 2 = ROUND(CAST("p"."MoneyValue" AS Double) * 2, 1) AND CAST("p"."MoneyValue" AS Double) <> ROUND(CAST("p"."MoneyValue" AS Double), 1) + THEN ROUND(CAST("p"."MoneyValue" AS Double) / 2, 1) * 2 + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 1) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) * 2 = ROUND(CAST("t"."MoneyValue" AS Double) * 2, 1) AND CAST("t"."MoneyValue" AS Double) <> ROUND(CAST("t"."MoneyValue" AS Double), 1) - THEN ROUND(CAST("t"."MoneyValue" AS Double) / 2, 1) * 2 - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 1) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,1).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,1).sql index 081c9fedacaf..3f8628b4c4f0 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,1).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT - ROUND("p"."MoneyValue", 1) as "c1", - "p"."MoneyValue" + ROUND("p"."MoneyValue", 1) as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,2).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,2).sql index 081c9fedacaf..3f8628b4c4f0 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,2).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT - ROUND("p"."MoneyValue", 1) as "c1", - "p"."MoneyValue" + ROUND("p"."MoneyValue", 1) as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,1).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,1).sql index 1629f3650011..635777945c40 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,1).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,1).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,2).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,2).sql index 1629f3650011..635777945c40 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,2).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SapHana.Odbc,ToEven,2).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc).sql index 1c17d9138c5e..aa6649309eaa 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SapHana.Odbc).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) - FLOOR(CAST("p"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("p"."MoneyValue" AS Double)), 2) = 0 + THEN FLOOR(CAST("p"."MoneyValue" AS Double)) + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) - FLOOR(CAST("t"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("t"."MoneyValue" AS Double)), 2) = 0 - THEN FLOOR(CAST("t"."MoneyValue" AS Double)) - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc).sql index 1629f3650011..635777945c40 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SapHana.Odbc).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN "p"."MoneyValue" * 2 = ROUND("p"."MoneyValue" * 2, 1) AND "p"."MoneyValue" <> ROUND("p"."MoneyValue", 1) THEN ROUND("p"."MoneyValue" / 2, 1) * 2 ELSE ROUND("p"."MoneyValue", 1) - END as "c1", - "p"."MoneyValue" + END as "c1" FROM "LinqDataTypes" "p" ) "t" diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc).sql index 2292ffd9be71..05773ccef9cc 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SapHana.Odbc).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) * 2 = ROUND(CAST("p"."MoneyValue" AS Double) * 2, 1) AND CAST("p"."MoneyValue" AS Double) <> ROUND(CAST("p"."MoneyValue" AS Double), 1) + THEN ROUND(CAST("p"."MoneyValue" AS Double) / 2, 1) * 2 + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 1) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) * 2 = ROUND(CAST("t"."MoneyValue" AS Double) * 2, 1) AND CAST("t"."MoneyValue" AS Double) <> ROUND(CAST("t"."MoneyValue" AS Double), 1) - THEN ROUND(CAST("t"."MoneyValue" AS Double) / 2, 1) * 2 - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 1) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc).sql index 6fefaca81edb..11b5e0d97433 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SapHana.Odbc).sql @@ -2,9 +2,14 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + ROUND("p"."MoneyValue") as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - ROUND("t"."MoneyValue") <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc).sql index 2ddae88b9382..18184159ea76 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SapHana.Odbc).sql @@ -2,9 +2,14 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + ROUND(CAST("p"."MoneyValue" AS Double)) as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - ROUND(CAST("t"."MoneyValue" AS Double)) <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc).sql index 81cc22019642..c14354931b39 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SapHana.Odbc).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN "p"."MoneyValue" - FLOOR("p"."MoneyValue") = 0.5 AND MOD(FLOOR("p"."MoneyValue"), 2) = 0 + THEN FLOOR("p"."MoneyValue") + ELSE ROUND("p"."MoneyValue", 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN "t"."MoneyValue" - FLOOR("t"."MoneyValue") = 0.5 AND MOD(FLOOR("t"."MoneyValue"), 2) = 0 - THEN FLOOR("t"."MoneyValue") - ELSE ROUND("t"."MoneyValue", 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc).sql index 1c17d9138c5e..aa6649309eaa 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SapHana.Odbc).sql @@ -2,13 +2,18 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + CASE + WHEN CAST("p"."MoneyValue" AS Double) - FLOOR(CAST("p"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("p"."MoneyValue" AS Double)), 2) = 0 + THEN FLOOR(CAST("p"."MoneyValue" AS Double)) + ELSE ROUND(CAST("p"."MoneyValue" AS Double), 0) + END as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - CASE - WHEN CAST("t"."MoneyValue" AS Double) - FLOOR(CAST("t"."MoneyValue" AS Double)) = 0.5 AND MOD(FLOOR(CAST("t"."MoneyValue" AS Double)), 2) = 0 - THEN FLOOR(CAST("t"."MoneyValue" AS Double)) - ELSE ROUND(CAST("t"."MoneyValue" AS Double), 0) - END <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc).sql index 5ece889b17d2..ffe45ab32a69 100644 --- a/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SapHana.Odbc).sql @@ -2,9 +2,14 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "t"."MoneyValue" + "t"."c1" FROM - "LinqDataTypes" "t" + ( + SELECT + ROUND("p"."MoneyValue", 1) as "c1" + FROM + "LinqDataTypes" "p" + ) "t" WHERE - ROUND("t"."MoneyValue", 1) <> 0 + "t"."c1" <> 0 diff --git a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc).sql index f54de4d30f15..88c7f1af8651 100644 --- a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SapHana.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 2 + "s"."Int" = 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 2 + "s"."Int" <> 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 4 + "s"."Int" = 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 4 + "s"."Int" <> 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NULL + "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NOT NULL + "s"."NullableInt" IS NOT NULL diff --git a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc).sql index f54de4d30f15..88c7f1af8651 100644 --- a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SapHana.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 2 + "s"."Int" = 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 2 + "s"."Int" <> 2 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" = 4 + "s"."Int" = 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."Int" <> 4 + "s"."Int" <> 4 BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 2 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 2 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL + "s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableInt" = 4 OR "x"."NullableInt" IS NULL) + NOT ("s"."NullableInt" = 4 OR "s"."NullableInt" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NULL + "s"."NullableInt" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableInt" IS NOT NULL + "s"."NullableInt" IS NOT NULL diff --git a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc).sql index 231a040ee054..545622f4517a 100644 --- a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SapHana.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'abc' OR "x"."String" IS NULL + "s"."String" = 'abc' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'abc' OR "x"."String" IS NULL) + NOT ("s"."String" = 'abc' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'xyz' OR "x"."String" IS NULL + "s"."String" = 'xyz' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'xyz' OR "x"."String" IS NULL) + NOT ("s"."String" = 'xyz' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NULL + "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NOT NULL + "s"."String" IS NOT NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NULL + "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NOT NULL + "s"."NullableString" IS NOT NULL diff --git a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc).sql index 231a040ee054..545622f4517a 100644 --- a/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SapHana.Odbc).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'abc' OR "x"."String" IS NULL + "s"."String" = 'abc' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'abc' OR "x"."String" IS NULL) + NOT ("s"."String" = 'abc' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" = 'xyz' OR "x"."String" IS NULL + "s"."String" = 'xyz' OR "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."String" = 'xyz' OR "x"."String" IS NULL) + NOT ("s"."String" = 'xyz' OR "s"."String" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NULL + "s"."String" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."String" IS NOT NULL + "s"."String" IS NOT NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'abc' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'abc' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL + "s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - NOT ("x"."NullableString" = 'xyz' OR "x"."NullableString" IS NULL) + NOT ("s"."NullableString" = 'xyz' OR "s"."NullableString" IS NULL) BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NULL + "s"."NullableString" IS NULL BeforeExecute -- SapHana.Odbc SapHanaOdbc @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - "Src" "x" + "Src" "s" WHERE - "x"."NullableString" IS NOT NULL + "s"."NullableString" IS NOT NULL diff --git a/SapHana.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc).sql index 9309f5054496..b3ce8aab6abc 100644 --- a/SapHana.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SapHana.Odbc).sql @@ -16,12 +16,12 @@ FROM "Child" "a_Children" WHERE "p"."ParentID" = "a_Children"."ParentID" - ) as "COUNT_1" + ) as "Count_1" FROM "Parent" "p" ) "t1" INNER JOIN "Parent" "pp" ON "t1"."Value1" = "pp"."Value1" ORDER BY "pp"."ParentID", - "t1"."COUNT_1" + "t1"."Count_1" diff --git a/SapHana.Odbc/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc).sql index 80f0bf62e0ff..2116d0821c0b 100644 --- a/SapHana.Odbc/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SapHana.Odbc).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), "x"."Key_1", "x"."Count_1", - "x"."MAX_1" + "x"."Max_1" FROM ( SELECT "summary"."LastName" as "Key_1", COUNT(*) as "Count_1", - MAX("summary"."FirstName") as "MAX_1" + MAX("summary"."FirstName") as "Max_1" FROM "Person" "summary" GROUP BY diff --git a/SapHana.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SapHana.Odbc).sql new file mode 100644 index 000000000000..8637a450e335 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SapHana.Odbc).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Coalesce("t"."Value2", '') +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Coalesce("t"."Value3", '') +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + SUBSTRING(Coalesce(' -> ' || "t"."Value3", '') || Coalesce(' -> ' || "t"."Value1", '') || Coalesce(' -> ' || "t"."Value2", ''), 5) +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + SUBSTRING(Coalesce(' -> ' || "t"."Value3", '') || Coalesce(' -> ' || "t"."Value3", ''), 5) +FROM + "SampleClass" "t" +ORDER BY + "t"."Id" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SapHana.Odbc).sql new file mode 100644 index 000000000000..d90e3f5d95a3 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArray(SapHana.Odbc).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Coalesce("t"."NullableValue", '') || ', ' || "t"."NotNullableValue" || ', ' || Coalesce("t"."VarcharValue", '') || ', ' || Coalesce("t"."NVarcharValue", ''), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t2"."item_1", ''), ', ' ORDER BY "t2"."item_1" NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t1"."item" as "item_1" + FROM + ( + SELECT "t"."NotNullableValue" AS "item" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NVarcharValue" FROM DUMMY) "t1" + WHERE + "t1"."item" IS NOT NULL + ) "t2" + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t4"."item_1", ''), ', ' ORDER BY CASE + WHEN "t4"."item_1" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, "t4"."item_1" NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t3"."item" as "item_1" + FROM + ( + SELECT "t"."NotNullableValue" AS "item" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."NVarcharValue" FROM DUMMY) "t3" + WHERE + "t3"."item" <> 'A' OR "t3"."item" IS NULL + ) "t4" + ) +FROM + "SampleClass" "t" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SapHana.Odbc).sql new file mode 100644 index 000000000000..af22d978cc5e --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SapHana.Odbc).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + SUBSTRING(Coalesce(', ' || "t"."NullableValue", '') || ', ' || "t"."NotNullableValue" || Coalesce(', ' || "t"."VarcharValue", '') || Coalesce(', ' || "t"."NVarcharValue", ''), 3), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t2"."item_1", ''), ', ' ORDER BY "t2"."item_1" NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t1"."item" as "item_1" + FROM + ( + SELECT "t"."NullableValue" AS "item" FROM DUMMY + UNION ALL + SELECT "t"."NotNullableValue" FROM DUMMY + UNION ALL + SELECT "t"."VarcharValue" FROM DUMMY + UNION ALL + SELECT "t"."NVarcharValue" FROM DUMMY) "t1" + WHERE + "t1"."item" IS NOT NULL + ) "t2" + ) +FROM + "SampleClass" "t" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SapHana.Odbc).sql new file mode 100644 index 000000000000..5d83d482427c --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SapHana.Odbc).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."c1" +FROM + ( + SELECT + SUBSTRING(Coalesce(', ' || CASE + WHEN "t"."NullableValue" LIKE '%A%' ESCAPE '~' THEN "t"."NullableValue" + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN "t"."NotNullableValue" LIKE '%A%' ESCAPE '~' THEN "t"."NotNullableValue" + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN "t"."VarcharValue" LIKE '%A%' ESCAPE '~' THEN "t"."VarcharValue" + ELSE NULL + END, '') || Coalesce(', ' || CASE + WHEN "t"."NVarcharValue" LIKE '%A%' ESCAPE '~' THEN "t"."NVarcharValue" + ELSE NULL + END, ''), 3) as "c1" + FROM + "SampleClass" "t" + ) "x" +WHERE + LTRIM("x"."c1", ' + …             

  ') <> '' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SapHana.Odbc).sql new file mode 100644 index 000000000000..f57210d503ed --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SapHana.Odbc).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Coalesce(STRING_AGG(Coalesce("t1"."NullableValue", ''), ', ' ORDER BY "t1"."NotNullableValue" NULLS FIRST), '') +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SapHana.Odbc).sql new file mode 100644 index 000000000000..b2a9f465b6e1 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SapHana.Odbc).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc (asynchronously) + +SELECT + Coalesce(STRING_AGG("t1"."NullableValue", ', ' ORDER BY "t1"."NotNullableValue"), '') +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SapHana.Odbc).sql new file mode 100644 index 000000000000..f74624403195 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SapHana.Odbc).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Coalesce(STRING_AGG("t1"."NullableValue", ', ' ORDER BY "t1"."NotNullableValue"), '') +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SapHana.Odbc).sql new file mode 100644 index 000000000000..6dc58f2165a0 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SapHana.Odbc).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "g_1"."Id", + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', '), + STRING_AGG("g_1"."NotNullableValue", ', ') +FROM + "SampleClass" "g_1" +GROUP BY + "g_1"."Id" +ORDER BY + "g_1"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SapHana.Odbc).sql new file mode 100644 index 000000000000..eba9577e2cf4 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SapHana.Odbc).sql @@ -0,0 +1,63 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t5"."Key_1", + "t2"."Join_1", + "t4"."Join_1" +FROM + ( + SELECT + "g_1"."Id" as "Key_1" + FROM + "SampleClass" "g_1" + GROUP BY + "g_1"."Id" + ) "t5" + LEFT JOIN LATERAL ( + SELECT + Coalesce(STRING_AGG(Coalesce("t1"."NullableValue", ''), ', '), '') as "Join_1" + FROM + ( + SELECT + "x"."NullableValue" + FROM + "SampleClass" "x" + WHERE + "t5"."Key_1" = "x"."Id" + ORDER BY + "x"."NotNullableValue" + LIMIT 2 + ) "t1" + ) "t2" ON 1=1 + LEFT JOIN LATERAL ( + SELECT + Coalesce(STRING_AGG("t3"."NotNullableValue", ', '), '') as "Join_1" + FROM + ( + SELECT + "x_1"."NotNullableValue" + FROM + "SampleClass" "x_1" + WHERE + "t5"."Key_1" = "x_1"."Id" + ORDER BY + "x_1"."NotNullableValue" + LIMIT 2 + ) "t3" + ) "t4" ON 1=1 +ORDER BY + "t5"."Key_1" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SapHana.Odbc).sql new file mode 100644 index 000000000000..8fa5be128d4b --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrderSimple(SapHana.Odbc).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "g_1"."Id", + Coalesce(STRING_AGG("g_1"."NullableValue", ', ' ORDER BY "g_1"."NullableValue", "g_1"."Id"), ''), + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', ' ORDER BY "g_1"."NullableValue" NULLS FIRST) +FROM + "SampleClass" "g_1" +GROUP BY + "g_1"."Id" +ORDER BY + "g_1"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SapHana.Odbc).sql new file mode 100644 index 000000000000..f3499d133bd5 --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingOrdered(SapHana.Odbc).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "g_1"."Id", + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', ' ORDER BY "g_1"."NotNullableValue" NULLS FIRST, "g_1"."NullableValue" DESC NULLS FIRST), + Coalesce(STRING_AGG(CASE + WHEN "g_1"."NullableValue" <> '' THEN "g_1"."NullableValue" + ELSE NULL + END, ', ' ORDER BY "g_1"."NotNullableValue", "g_1"."NullableValue" DESC), ''), + STRING_AGG("g_1"."NotNullableValue", ', ' ORDER BY "g_1"."NotNullableValue" DESC NULLS FIRST, "g_1"."NullableValue" DESC NULLS FIRST), + STRING_AGG(Coalesce("g_1"."NullableValue", ''), ', ' ORDER BY "g_1"."NotNullableValue" DESC NULLS FIRST), + STRING_AGG("g_1"."NotNullableValue", ', ' ORDER BY "g_1"."NotNullableValue" DESC NULLS FIRST), + STRING_AGG("g_1"."NotNullableValue", ', ' ORDER BY CASE + WHEN "g_1"."NullableValue" IS NULL THEN 0 + ELSE 1 + END NULLS FIRST, "g_1"."NotNullableValue" DESC NULLS FIRST, "g_1"."NullableValue" NULLS FIRST) +FROM + "SampleClass" "g_1" +GROUP BY + "g_1"."Id" +ORDER BY + "g_1"."Id" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SapHana.Odbc).sql new file mode 100644 index 000000000000..04144528550b --- /dev/null +++ b/SapHana.Odbc/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingVarious(SapHana.Odbc).sql @@ -0,0 +1,94 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Key_1", + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t2"."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + "t"."NullableValue" + FROM + "SampleClass" "t" + WHERE + "t1"."Key_1" = "t"."Id" + ) "t2" + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t3"."NullableValue", ''), ', '), '') + FROM + ( + SELECT DISTINCT + "t_1"."NullableValue" + FROM + "SampleClass" "t_1" + WHERE + "t1"."Key_1" = "t_1"."Id" AND "t_1"."NullableValue" IS NOT NULL + ) "t3" + ), + ( + SELECT + Coalesce(STRING_AGG(Coalesce("t4"."NullableValue", ''), ', ' ORDER BY "t4"."NullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t_2"."NullableValue" + FROM + "SampleClass" "t_2" + WHERE + "t1"."Key_1" = "t_2"."Id" AND "t_2"."NullableValue" IS NOT NULL + ) "t4" + ), + ( + SELECT + Coalesce(STRING_AGG("t5"."NotNullableValue", ', '), '') + FROM + ( + SELECT DISTINCT + "t_3"."NotNullableValue" + FROM + "SampleClass" "t_3" + WHERE + "t1"."Key_1" = "t_3"."Id" + ) "t5" + ), + ( + SELECT + Coalesce(STRING_AGG("t6"."NotNullableValue", ', ' ORDER BY "t6"."NotNullableValue" DESC NULLS FIRST), '') + FROM + ( + SELECT DISTINCT + "t_4"."NotNullableValue" + FROM + "SampleClass" "t_4" + WHERE + "t1"."Key_1" = "t_4"."Id" + ) "t6" + ) +FROM + ( + SELECT + "g_1"."Id" as "Key_1" + FROM + "SampleClass" "g_1" + GROUP BY + "g_1"."Id" + ) "t1" +ORDER BY + "t1"."Key_1" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."Id", + "t1"."NullableValue", + "t1"."NotNullableValue", + "t1"."VarcharValue", + "t1"."NVarcharValue" +FROM + "SampleClass" "t1" + diff --git a/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc).sql index ef0635d097d0..94ce4ece9747 100644 --- a/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SapHana.Odbc).sql @@ -9,30 +9,25 @@ SELECT "d"."Amount", "d"."Currency" FROM - ( - SELECT DISTINCT - "x"."Id" + "TransactionEntity" "m_1" + INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" "x" + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - "x"."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - "t1"."item" - FROM - ( - SELECT 'A' AS "item" FROM DUMMY - UNION ALL - SELECT 'B' FROM DUMMY) "t1" - ) - ) "m_1" - INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" + "m_1"."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + "t1"."item" + FROM + ( + SELECT 'A' AS "item" FROM DUMMY + UNION ALL + SELECT 'B' FROM DUMMY) "t1" + ) BeforeExecute DisposeTransaction diff --git a/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc).sql index b248d14b7d43..a5a98e503feb 100644 --- a/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SapHana.Odbc).sql @@ -9,30 +9,25 @@ SELECT "d"."Amount", "d"."Currency" FROM - ( - SELECT DISTINCT - "x"."Id" + "TransactionEntity" "m_1" + INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" +WHERE + EXISTS( + SELECT + "a_Lines"."Currency" FROM - "TransactionEntity" "x" + "LineEntity" "a_Lines" WHERE - EXISTS( - SELECT - "a_Lines"."Currency" - FROM - "LineEntity" "a_Lines" - WHERE - "x"."Id" = "a_Lines"."TransactionId" - INTERSECT - SELECT - "t1"."item" - FROM - ( - SELECT 'A' AS "item" FROM DUMMY - UNION ALL - SELECT 'B' FROM DUMMY) "t1" - ) - ) "m_1" - INNER JOIN "LineEntity" "d" ON "m_1"."Id" = "d"."TransactionId" + "m_1"."Id" = "a_Lines"."TransactionId" + INTERSECT + SELECT + "t1"."item" + FROM + ( + SELECT 'A' AS "item" FROM DUMMY + UNION ALL + SELECT 'B' FROM DUMMY) "t1" + ) BeforeExecute DisposeTransaction diff --git a/SapHana.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc).sql index 836e8f703411..8d846eab0343 100644 --- a/SapHana.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SapHana.Odbc).sql @@ -2,12 +2,12 @@ -- SapHana.Odbc SapHanaOdbc SELECT - "g_1"."COUNT_1" + "g_1"."Count_1" FROM ( SELECT "c_1"."ParentID" as "Key_1", - COUNT(*) as "COUNT_1" + COUNT(*) as "Count_1" FROM "Child" "c_1" GROUP BY @@ -16,5 +16,5 @@ FROM "c_1"."ParentID" > 1 ) "g_1" WHERE - "g_1"."Key_1" > 1 AND "g_1"."COUNT_1" > 1 + "g_1"."Key_1" > 1 AND "g_1"."Count_1" > 1 diff --git a/SapHana.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SapHana.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index b2a99eb1b687..76b5ad07ec83 100644 --- a/SapHana.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SapHana.Odbc/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SapHana.Odbc,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT "d"."ValB", "d"."ValInt" FROM - ( - SELECT DISTINCT - "l1"."ID", - "l1"."ValS" + "Issue3757Level1" "m_1" + INNER JOIN "Issue3757Level2" "d" ON "m_1"."ID" = "d"."ParentId" +WHERE + EXISTS( + SELECT + * FROM - "Issue3757Level1" "l1" + "Issue3757Level2" "c_1" WHERE - EXISTS( - SELECT - * - FROM - "Issue3757Level2" "c_1" - WHERE - "l1"."ID" = "c_1"."ParentId" AND "l1"."ValS" LIKE ? ESCAPE '~' AND - "l1"."ValS" IS NOT NULL - ) - ) "m_1" - INNER JOIN "Issue3757Level2" "d" ON "m_1"."ID" = "d"."ParentId" + "m_1"."ID" = "c_1"."ParentId" AND "m_1"."ValS" LIKE ? ESCAPE '~' AND + "m_1"."ValS" IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc).sql index 7b1a27428afe..cbc8468bfcb6 100644 --- a/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SapHana.Odbc).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT "x_1"."ParentID", "x_1"."CountResult", - "x_1"."SUM_1" + "x_1"."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "od_1" WHERE "x"."ParentID" = "od_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" "x" ) "x_1" diff --git a/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc).sql index d44434d8007d..708245b4b034 100644 --- a/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SapHana.Odbc).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT "x"."ParentID", "x"."CountResult", - "x"."SUM_1" + "x"."Sum_1" FROM ( SELECT @@ -56,7 +56,7 @@ FROM "Child" "a_Children_1" WHERE "o"."ParentID" = "a_Children_1"."ParentID" - ) as "SUM_1" + ) as "Sum_1" FROM "Parent" "o" ) "x" diff --git a/SapHana.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SapHana.Odbc).sql index 6c1f84618198..8eeb1fefa7ce 100644 --- a/SapHana.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SapHana.Odbc).sql @@ -9,17 +9,12 @@ SELECT "d"."ChildID" FROM ( - SELECT DISTINCT - "t2"."ParentID" + SELECT + "a_Parent"."ParentID" FROM - ( - SELECT - "a_Parent"."ParentID" - FROM - "Child" "t1" - LEFT JOIN "Parent" "a_Parent" ON "t1"."ParentID" = "a_Parent"."ParentID" - LIMIT 1 - ) "t2" + "Child" "t1" + LEFT JOIN "Parent" "a_Parent" ON "t1"."ParentID" = "a_Parent"."ParentID" + LIMIT 1 ) "m_1" INNER JOIN "Child" "d" ON "m_1"."ParentID" = "d"."ParentID" diff --git a/SapHana.Odbc/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc).sql index 96f3fa31f10e..1097d5b1fc27 100644 --- a/SapHana.Odbc/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SapHana.Odbc).sql @@ -20,7 +20,7 @@ FROM "vpc"."CategoryId", "pop"."ProductId", COALESCE("pcc"."PeriodOrderLimit",0) as "MaxCapacity", - COALESCE(COALESCE("vsp"."SUM_1",0),0) as "Quantity" + COALESCE(COALESCE("vsp"."Quantity",0),0) as "Quantity" FROM "OrderPeriod" "op" INNER JOIN "ProductsPerOrderPeriod" "pop" ON "op"."Id" = "pop"."OrderPeriodId" @@ -30,7 +30,7 @@ FROM SELECT "agroup"."Id", "oi"."ProductId", - SUM(COALESCE("oi"."Quantity",0)) as "SUM_1" + SUM(COALESCE("oi"."Quantity",0)) as "Quantity" FROM "OrderPeriod" "agroup" LEFT JOIN "OrderHeader" "oh" ON "agroup"."Id" = "oh"."PeriodId" diff --git a/SapHana.Odbc/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc).sql index e80135239d8f..ffff7aefa469 100644 --- a/SapHana.Odbc/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SapHana.Odbc).sql @@ -3,7 +3,7 @@ SELECT ' ' || CAST(Coalesce("t1"."Value1", 0) AS NVarChar(11)), - "t1"."SUM_1", + "t1"."SubSum", CASE WHEN EXISTS( SELECT @@ -38,12 +38,12 @@ FROM LEFT JOIN "Parent" "a_Parent" ON "c_1"."ParentID" = "a_Parent"."ParentID" WHERE "a_Parent"."ParentID" = "f"."ParentID" AND ("a_Parent"."Value1" = "f"."Value1" OR "a_Parent"."Value1" IS NULL AND "f"."Value1" IS NULL) - ) as "SUM_1", + ) as "SubSum", "f"."ParentID" FROM "Parent" "f" ) "t1" WHERE ' ' || CAST(Coalesce("t1"."Value1", 0) AS NVarChar(11)) LIKE '%1%' ESCAPE '~' AND - "t1"."SUM_1" > 0 + "t1"."SubSum" > 0 diff --git a/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc).sql index 5cda8035b030..e87fed6e1eb1 100644 --- a/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SapHana.Odbc).sql @@ -5,13 +5,13 @@ SELECT "p1"."ParentID", "p1"."Value1", "p2"."Key_1", - "p2"."SUM_1" + "p2"."Sum_1" FROM "Parent" "p1" INNER JOIN ( SELECT "g_1"."ParentID" as "Key_1", - SUM("g_1"."ParentID") as "SUM_1" + SUM("g_1"."ParentID") as "Sum_1" FROM "Parent" "g_1" WHERE diff --git a/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc).sql index e3cde0246839..cbceb92a877f 100644 --- a/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SapHana.Odbc).sql @@ -3,14 +3,14 @@ SELECT "t1"."Key_1", - "t1"."SUM_1", + "t1"."Sum_1", "p2"."Key_1", "p2"."Sum_1" FROM ( SELECT "g_1"."ParentID" as "Key_1", - SUM("g_1"."ParentID") as "SUM_1" + SUM("g_1"."ParentID") as "Sum_1" FROM "Parent" "g_1" WHERE diff --git a/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc).sql b/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc).sql index b97d569549df..b253b56b74c5 100644 --- a/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SapHana.Odbc).sql @@ -13,9 +13,9 @@ SET WHERE "b_1"."ChildID" = ( SELECT - MAX("b2_1"."ParentID") + MAX("t2"."ParentID") FROM - "Child" "b2_1" + "Child" "t2" ) AND "b_1"."ChildID" = -1 AND "Parent"."ParentID" = "w_1"."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE "b"."ChildID" = ( SELECT - MAX("b2"."ParentID") + MAX("t1"."ParentID") FROM - "Child" "b2" + "Child" "t1" ) AND "b"."ChildID" = -1 AND "Parent"."ParentID" = "w"."ParentID" AND diff --git a/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc).sql b/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc).sql index b97d569549df..b253b56b74c5 100644 --- a/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SapHana.Odbc).sql @@ -13,9 +13,9 @@ SET WHERE "b_1"."ChildID" = ( SELECT - MAX("b2_1"."ParentID") + MAX("t2"."ParentID") FROM - "Child" "b2_1" + "Child" "t2" ) AND "b_1"."ChildID" = -1 AND "Parent"."ParentID" = "w_1"."ParentID" AND @@ -31,9 +31,9 @@ WHERE WHERE "b"."ChildID" = ( SELECT - MAX("b2"."ParentID") + MAX("t1"."ParentID") FROM - "Child" "b2" + "Child" "t1" ) AND "b"."ChildID" = -1 AND "Parent"."ParentID" = "w"."ParentID" AND diff --git a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe.LinqService).sql index 5f14382a6801..730fe6cff3d7 100644 --- a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - AVG([t1].[ParentID]) as [AVG_1] + AVG([t1].[ParentID]) as [Average] FROM [Parent] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe.LinqService).sql index c20751362e1a..773b5a592fc7 100644 --- a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[ParentID]) as [MAX_1] + MAX([t1].[ParentID]) as [Max_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe.LinqService).sql index e62a628549e1..cfea92615331 100644 --- a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[MAX_1] + [t1].[Max_1] FROM [Parent] [p] OUTER APPLY ( SELECT - MAX([a_Children].[ParentID]) as [MAX_1] + MAX([a_Children].[ParentID]) as [Max_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlCe.LinqService).sql new file mode 100644 index 000000000000..53abb1dbe10a --- /dev/null +++ b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlCe.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlCe (asynchronously) + +SELECT + MIN([t1].[ParentID]) as [Min_1] +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlCe.LinqService).sql new file mode 100644 index 000000000000..27635b4c1fb0 --- /dev/null +++ b/SqlCe.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlCe.LinqService).sql @@ -0,0 +1,16 @@ +BeforeExecute +-- SqlCe (asynchronously) + +SELECT + [t1].[Min_1] +FROM + [Parent] [p] + OUTER APPLY ( + SELECT + MIN([a_Children].[ParentID]) as [Min_1] + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) [t1] + diff --git a/SqlCe.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe.LinqService).sql index 1440fa37bfa6..f230c25e0157 100644 --- a/SqlCe.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe.LinqService).sql index 91f466cae25d..dde2219a02d2 100644 --- a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [NotNullParent] [p] INNER JOIN [NotNullChild] [a_ChildInner] ON [p].[ID] = [a_ChildInner].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe.LinqService).sql index 16e02d4fa2e8..f845e53b51a9 100644 --- a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [NotNullParent] [p] diff --git a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe.LinqService).sql index 402b058ca4cd..a9e149ec8e10 100644 --- a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe.LinqService).sql @@ -3,12 +3,12 @@ SELECT [p].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe.LinqService).sql index 8b6aabbf6980..5d7dbc23988a 100644 --- a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe.LinqService).sql @@ -3,12 +3,12 @@ SELECT [t].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -20,12 +20,12 @@ BeforeExecute SELECT [t].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe.LinqService).sql index d136319d80a4..1244292e535e 100644 --- a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe.LinqService).sql @@ -3,12 +3,12 @@ SELECT [x].[Id], - [t1].[COUNT_1] + [t1].[Count_1] FROM [MainEntity] [x] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SubEntity] [a_SubEntities] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe.LinqService).sql index 5cacc08532a5..4b503a27a187 100644 --- a/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [MainEntity] [x] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SubEntity] [a_SubEntities] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe.LinqService).sql index 5bf634118410..4f52891cdacf 100644 --- a/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe.LinqService).sql @@ -9,12 +9,12 @@ SELECT [t2].[Gender], [t2].[LastName] + ', ' + [t2].[FirstName] as [FullName], [t2].[LastName] + ', ' + [t2].[FirstName] as [AsSqlFullName], - [t1].[COUNT_1] as [DoctorCount] + [t1].[DoctorCount] FROM [Person] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [DoctorCount] FROM [Doctor] [d] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe.LinqService).sql index f3048c81a110..33d4b411de05 100644 --- a/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [t2].[COUNT_1], + [t2].[Count_1], [t].[PersonID], [t].[FirstName], [t].[LastName], @@ -23,7 +23,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Doctor] [d_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe.LinqService).sql index c2339bba485b..c60090376b44 100644 --- a/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[ID]) as [MAX_1] + MAX([t1].[ID]) as [Max_1] FROM [AllTypes] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe.LinqService).sql index 292b4904b54f..1975cf28138c 100644 --- a/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[ID]) as [MAX_1] + MAX([t1].[ID]) as [Max_1] FROM [AllTypes] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe.LinqService).sql index c00c8329bb92..8851e862d114 100644 --- a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe.LinqService).sql index c00c8329bb92..8851e862d114 100644 --- a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe.LinqService).sql index a019b9107a4e..53ba4fa4c0af 100644 --- a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe.LinqService).sql index d59bc9889990..3857f93a2ee6 100644 --- a/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe.LinqService).sql index 1eb93b602427..d8134e4f4332 100644 --- a/SqlCe.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe.LinqService).sql index 5360620b8c34..34a53af9eb6d 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe.LinqService).sql index 5360620b8c34..34a53af9eb6d 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe.LinqService).sql index 5360620b8c34..a063b24476e7 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe.LinqService).sql index 5360620b8c34..34a53af9eb6d 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe.LinqService).sql index 2d5939ed7a41..d9ea00f90596 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe.LinqService).sql index 2d5939ed7a41..d9ea00f90596 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe.LinqService).sql index 2d5939ed7a41..d9ea00f90596 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe.LinqService).sql index 2d5939ed7a41..d9ea00f90596 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe.LinqService).sql index 80a6e4288ccb..8673fdcf1ccf 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe.LinqService).sql index 80a6e4288ccb..05dfa59c734f 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe.LinqService).sql index 3a4b01c245f4..f8e499bc01c5 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - MAX([c_1].[Id]) as [MAX_1] + MAX([c_1].[Id]) as [Max_1] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe.LinqService).sql index 85c91a8a20af..3953e427bcc2 100644 --- a/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - MIN([c_1].[Id]) as [MIN_1] + MIN([c_1].[Id]) as [Min_1] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql index 4f7a47f29fde..cf2331d7f34b 100644 --- a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe.LinqService).sql index f568f04f6dec..f1ed0ff95628 100644 --- a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([t3].[PersonID]) as [SUM_1] + SUM([t3].[PersonID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe.LinqService).sql index 8cf150bf2f44..b09518266bc0 100644 --- a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql index faae5ce61418..75adb4cd3073 100644 --- a/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,False).sql index 6ab904f18a31..ae7dfb407d10 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,True).sql index 3ee92934a8c3..cc2f5300dc25 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe.LinqService,True).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,False).sql index 94e91330e949..2ddb0a6e5189 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlCe (asynchronously) DECLARE @In NVarChar -- String SET @In = NULL -DECLARE @In_1 NVarChar -- String -SET @In_1 = NULL SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlCe (asynchronously) DECLARE @NotIn NVarChar -- String SET @NotIn = NULL -DECLARE @NotIn_1 NVarChar -- String -SET @NotIn_1 = NULL SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,True).sql index 711caa773322..8506e9bbaeea 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe.LinqService,True).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,False).sql index 5afb49d7802b..26ae91462a5a 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,True).sql index f8c124419ebd..7fdd3afa8cf8 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe.LinqService,True).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,False).sql index d180d8e66ba9..1a8eb1b381dd 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,True).sql index d180d8e66ba9..1a8eb1b381dd 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe.LinqService,True).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,False).sql index d180d8e66ba9..1a8eb1b381dd 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,True).sql index d180d8e66ba9..1a8eb1b381dd 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe.LinqService,True).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,False).sql index d180d8e66ba9..1a8eb1b381dd 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,True).sql index d180d8e66ba9..1a8eb1b381dd 100644 --- a/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe.LinqService,True).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe.LinqService).sql index 034fab411884..78f6d92d6dc4 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe.LinqService).sql @@ -14,7 +14,7 @@ SELECT THEN 1 ELSE 0 END as [c1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t2].[ChildID], [t3].[ParentID] as [ParentID_1], @@ -23,7 +23,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe.LinqService).sql index 034fab411884..78f6d92d6dc4 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe.LinqService).sql @@ -14,7 +14,7 @@ SELECT THEN 1 ELSE 0 END as [c1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t2].[ChildID], [t3].[ParentID] as [ParentID_1], @@ -23,7 +23,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe.LinqService).sql index 350439368bf8..ae41fb5c4dc9 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe.LinqService).sql @@ -14,7 +14,7 @@ SELECT THEN 1 ELSE 0 END as [c1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t3].[ParentID] as [ParentID_1], [t3].[ChildID] @@ -22,7 +22,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe.LinqService).sql index 676d4f178461..3717faf6b75c 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe.LinqService).sql @@ -15,7 +15,7 @@ SELECT THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -23,7 +23,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe.LinqService).sql index 676d4f178461..3717faf6b75c 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe.LinqService).sql @@ -15,7 +15,7 @@ SELECT THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -23,7 +23,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe.LinqService).sql index 41be0967973c..ee3fb7161de3 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe.LinqService).sql @@ -17,7 +17,7 @@ SELECT TOP (@take) THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -25,7 +25,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe.LinqService).sql index 41be0967973c..ee3fb7161de3 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe.LinqService).sql @@ -17,7 +17,7 @@ SELECT TOP (@take) THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -25,7 +25,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe.LinqService).sql index d592f2b70312..058f8551c599 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe.LinqService).sql @@ -18,7 +18,7 @@ SELECT THEN 1 ELSE 0 END as [c2], - [t3].[COUNT_1], + [t3].[Count_1], [t4].[ParentID], [t4].[ChildID] FROM @@ -47,7 +47,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_3] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe.LinqService).sql index 802b8fb8e4b6..7539a60255d7 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe.LinqService).sql index 0ab7d8a2e185..150bd07d6ce1 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe.LinqService).sql index 6806db551999..a3e09f881ad6 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [t] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe.LinqService).sql index 6806db551999..a3e09f881ad6 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [t] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe.LinqService).sql index 0dc751334567..5d3828b4b91d 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe.LinqService).sql index 0dc751334567..5d3828b4b91d 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe.LinqService).sql index 574897ec0cfe..e635e3470fa0 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe.LinqService).sql index d8ef11b4167b..148678fbe896 100644 --- a/SqlCe.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) as [Length_1] FROM [LinqDataTypes] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe.LinqService).sql index 3aab68e247a7..6a20791d4d67 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe.LinqService).sql index 3aab68e247a7..6a20791d4d67 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe.LinqService).sql index 895d3308ebb5..dc40e4cd111b 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe.LinqService).sql index 895d3308ebb5..dc40e4cd111b 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe.LinqService).sql index 0bb41a09d512..65c9f78565c7 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe.LinqService).sql index 27dd45fff9fa..47f4f14a8afd 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[Count_1] FROM [Parent] [p] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [t1] ) [t2] ON 1=1 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe.LinqService).sql index 611b75c9a51a..2c6fe75cf699 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe.LinqService).sql index cb24b16783b7..5379fa1530b9 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe.LinqService).sql index 850ab125eab5..8ff096496420 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe.LinqService).sql @@ -2,10 +2,10 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -13,10 +13,10 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe.LinqService).sql index bc01930ffd39..ecfbd5126946 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe.LinqService).sql @@ -2,10 +2,10 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe.LinqService).sql index 0f55aae48d1f..2559f6764540 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe.LinqService).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe.LinqService).sql index 13626661d4b0..53e0b3ffa7a7 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe.LinqService).sql index c493a3cd140e..cd12c968c1f8 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe.LinqService).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe.LinqService).sql index 3984cab5e3df..171f7053f640 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe.LinqService).sql @@ -7,7 +7,7 @@ SELECT COUNT(CASE WHEN [g_2].[ParentID] < 3 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe.LinqService).sql index 0cba974b5360..aa46bf19f095 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe.LinqService).sql @@ -7,7 +7,7 @@ SELECT COUNT(CASE WHEN [g_2].[ParentID] < 3 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe.LinqService).sql index 8e4e6fe7adb1..b9db29c53c64 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe.LinqService).sql @@ -3,11 +3,11 @@ SELECT [g_2].[ParentID], - MIN([g_2].[ChildID]) as [MIN_1], + MIN([g_2].[ChildID]) as [Min_1], COUNT(CASE WHEN [g_2].[ChildID] > 25 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe.LinqService).sql index 7f40acbd8f44..cbbecef4dfe4 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe.LinqService).sql index 611b75c9a51a..2c6fe75cf699 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe.LinqService).sql index 8393f97b0c48..af21fa6813bd 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe.LinqService).sql @@ -2,8 +2,8 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1], - MAX([g_1].[ChildID]) as [MAX_1] + COUNT(*) as [Count_1], + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe.LinqService).sql index 722e8704b81d..9255d2891e8f 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [ch] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe.LinqService).sql index 32ca4ac0f4da..ebecd82c17bd 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe.LinqService).sql index 2e7950050a4c..da085bb63c8d 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe.LinqService).sql index 96a75b339807..6704cd746e4f 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe.LinqService).sql @@ -2,13 +2,13 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], - [t2].[COUNT_1] as [COUNT_2] + [t1].[Count_1], + [t2].[Count_1] as [Count_2] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe.LinqService).sql index 96a75b339807..6704cd746e4f 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe.LinqService).sql @@ -2,13 +2,13 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], - [t2].[COUNT_1] as [COUNT_2] + [t1].[Count_1], + [t2].[Count_1] as [Count_2] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe.LinqService).sql index 064f9fea2760..3ee54734f46b 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe.LinqService).sql index 1285057c4614..ff38df2ac169 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[COUNT_1] as [c1] + [t1].[Count_1] + [t1].[Count_1] as [c1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe.LinqService).sql index 4eb8e60c73da..9d140bcb8e16 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe.LinqService).sql @@ -3,12 +3,12 @@ SELECT [p].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe.LinqService).sql index 7b000cf6f5a1..a042fa6199a9 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe.LinqService).sql @@ -3,14 +3,14 @@ SELECT CASE - WHEN [p].[Value1] IS NULL THEN [t1].[COUNT_1] - ELSE [t2].[COUNT_1] + WHEN [p].[Value1] IS NULL THEN [t1].[Count_1] + ELSE [t2].[Count_1] END as [c1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -18,11 +18,11 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) [t2] WHERE [p].[ParentID] <> 5 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe.LinqService).sql index 7b000cf6f5a1..a042fa6199a9 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe.LinqService).sql @@ -3,14 +3,14 @@ SELECT CASE - WHEN [p].[Value1] IS NULL THEN [t1].[COUNT_1] - ELSE [t2].[COUNT_1] + WHEN [p].[Value1] IS NULL THEN [t1].[Count_1] + ELSE [t2].[Count_1] END as [c1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -18,11 +18,11 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) [t2] WHERE [p].[ParentID] <> 5 diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe.LinqService).sql index e392681d23a4..cb218af5467a 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe.LinqService).sql index e392681d23a4..cb218af5467a 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe.LinqService).sql index 315dfe76dc20..870716907e77 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[COUNT_1]) as [MAX_1] + MAX([t1].[Count_1]) as [Max_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe.LinqService).sql index 315dfe76dc20..870716907e77 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[COUNT_1]) as [MAX_1] + MAX([t1].[Count_1]) as [Max_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe.LinqService).sql index 53cdc22fb349..bfc051ded522 100644 --- a/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[COUNT_1]) as [MAX_1] + MAX([t1].[Count_1]) as [Max_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe.LinqService).sql index e6a63daf6a4f..16ebe30eeceb 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe.LinqService).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe.LinqService).sql index 05d6c9ea4936..6ae1bf447efe 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe.LinqService).sql @@ -48,7 +48,7 @@ DECLARE @part2 Int -- Int32 SET @part2 = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe.LinqService).sql index c66519e33a84..faac1c127671 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe.LinqService).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe.LinqService).sql index 7057287c5234..e4172d19d57a 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe.LinqService).sql @@ -48,7 +48,7 @@ DECLARE @part2 Int -- Int32 SET @part2 = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe.LinqService).sql index 024d81f93fcc..ca739eb1f407 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe.LinqService).sql @@ -3,9 +3,9 @@ SELECT [g_1].[ID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) as [Value_1], - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) as [MAX_1] + MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) as [Max_1] FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe.LinqService).sql index e110d6201e58..990c3cf31cf4 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe.LinqService).sql @@ -5,7 +5,7 @@ SET @take = 5 SELECT TOP (@take) [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe.LinqService).sql index 339112e7639e..8870675a533f 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01' AS DateTime) as [c1] + CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01' AS DateTime) as [Value_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe.LinqService).sql index d9869275c3af..1a514f53ac6e 100644 --- a/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01 20:35:44.000' AS DateTime) as [c1] + CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01 20:35:44.000' AS DateTime) as [Value_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe.LinqService).sql index 2e1eab6680ef..c3a266c840b1 100644 --- a/SqlCe.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [t2].[SUM_1] + [t2].[Sum_1] FROM [Parent] [p] OUTER APPLY ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END) as [SUM_1] + END) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe.LinqService).sql index d69dec1a13e4..a30c0e6dfbf2 100644 --- a/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT diff --git a/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe.LinqService).sql index 1d0581129e10..1c2e6c207982 100644 --- a/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[ParentID]) as [MAX_1] + MAX([t1].[ParentID]) as [Max_1] FROM ( SELECT DISTINCT diff --git a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe.LinqService).sql index fb66efd3540a..68e5dad728be 100644 --- a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [p].[FirstName] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe.LinqService).sql index 21f7a01550ff..e00fe0057d2f 100644 --- a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [a_Patient].[Diagnosis] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] LEFT JOIN [Patient] [a_Patient] ON [p].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe.LinqService).sql index 4fc1dda2c839..96acbc626d3e 100644 --- a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_1].[FirstName] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe.LinqService).sql index dc50e89c6968..6c35f463561e 100644 --- a/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [g_1].[FirstName], [g_1].[LastName], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe.LinqService).sql index 456f9205ddd9..044c557724a0 100644 --- a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe.LinqService).sql @@ -8,12 +8,12 @@ FROM [Item] [x] OUTER APPLY ( SELECT - SUM([a_Values].[Value]) as [SUM_1] + SUM([a_Values].[Value]) as [Sum_1] FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] ) [t1] ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] diff --git a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe.LinqService).sql index d5901beb39d6..610aa75b25e0 100644 --- a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe.LinqService).sql @@ -18,12 +18,12 @@ FROM [Item] [x] OUTER APPLY ( SELECT - SUM([a_Values].[Value]) as [SUM_1] + SUM([a_Values].[Value]) as [Sum_1] FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] ) [t1] ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] diff --git a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe.LinqService).sql index cee03a6feea1..9055d9bc0405 100644 --- a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe.LinqService).sql @@ -18,12 +18,12 @@ FROM [Item] [x] OUTER APPLY ( SELECT - SUM([a_Values].[Value]) as [SUM_1] + SUM([a_Values].[Value]) as [Sum_1] FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] ) [t1] ORDER BY - Coalesce([t1].[SUM_1], 0) + Coalesce([t1].[Sum_1], 0) diff --git a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe.LinqService).sql index 61919fc4ad78..36a35d039722 100644 --- a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe.LinqService).sql @@ -2,13 +2,13 @@ -- SqlCe (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe.LinqService).sql index 0110dac5c659..52e7d349d1dc 100644 --- a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [DetailClass] [a_Details] WHERE @@ -15,7 +15,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT @@ -35,7 +35,7 @@ FROM ) [t3] ) [t4] WHERE - [t1].[COUNT_1] > 1 + [t1].[Count_1] > 1 BeforeExecute -- SqlCe (asynchronously) diff --git a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe.LinqService).sql index f667896390b9..34327234252f 100644 --- a/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe.LinqService).sql @@ -43,10 +43,10 @@ FROM [Person] [p], ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [UserIssue3128] [t1] ) [t2] WHERE - [t2].[COUNT_1] > 0 + [t2].[Count_1] > 0 diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe.LinqService).sql index 308f257045e2..6da7c83a17a5 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe.LinqService).sql index 308f257045e2..6da7c83a17a5 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe.LinqService).sql index 308f257045e2..6da7c83a17a5 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe.LinqService).sql index 308f257045e2..6da7c83a17a5 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe.LinqService).sql index 9d3a44f7214a..17712fc198e3 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe.LinqService).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe.LinqService).sql index 9d3a44f7214a..17712fc198e3 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe.LinqService).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe.LinqService).sql index 9d3a44f7214a..17712fc198e3 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe.LinqService).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe.LinqService).sql index 9d3a44f7214a..17712fc198e3 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe.LinqService).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe.LinqService).sql index ac64c8647714..76e88f15dc6c 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe.LinqService).sql index 9101859f9eec..b95fb77fd1d0 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe.LinqService).sql @@ -34,7 +34,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe.LinqService).sql index ac64c8647714..76e88f15dc6c 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe.LinqService).sql index d9b0d4c087d2..233e6ccbfd94 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe.LinqService).sql @@ -34,7 +34,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe.LinqService).sql index 6f6ee2a6950c..5427d42c6b48 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe.LinqService).sql index 3cc2564ef172..4cd11b2a20d4 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe.LinqService).sql index 3cc2564ef172..4cd11b2a20d4 100644 --- a/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe.LinqService).sql index 7520efa81656..b2803e089a7d 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] INNER JOIN [GrandChild] [a_GrandChildren] ON [a_Children].[ParentID] = [a_GrandChildren].[ParentID] AND [a_Children].[ChildID] = [a_GrandChildren].[ChildID] diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe.LinqService).sql index 13f267315f5c..5c2036435d1e 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe.LinqService).sql @@ -11,12 +11,12 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] INNER JOIN [GrandChild] [a_GrandChildren] ON [a_Children].[ParentID] = [a_GrandChildren].[ParentID] AND [a_Children].[ChildID] = [a_GrandChildren].[ChildID] diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe.LinqService).sql index 2b3a1e3c0d5b..a00de24ee92b 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe.LinqService).sql @@ -14,7 +14,7 @@ SELECT [Person] [t7] CROSS JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [t1] WHERE @@ -29,7 +29,7 @@ SELECT ) [t3] CROSS JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [t4] WHERE @@ -43,7 +43,7 @@ SELECT ) ) [t6] WHERE - [t3].[COUNT_1] = 0 AND [t6].[COUNT_1] = 0 + [t3].[Count_1] = 0 AND [t6].[Count_1] = 0 ) THEN 1 ELSE 0 diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe.LinqService).sql index 37969c2aa9fb..77cc4b4efa28 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe.LinqService).sql @@ -3,12 +3,12 @@ SELECT [t2].[Id], - [t1].[COUNT_1] as [PersonsCount] + [t1].[PersonsCount] FROM [Issue3472TableDCTX] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [PersonsCount] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe.LinqService).sql index 71666d16ed9b..043163a77a56 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe.LinqService).sql @@ -2,15 +2,15 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) [t1] diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe.LinqService).sql index 987eef1d03f8..04a2adc7512c 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe.LinqService).sql @@ -2,15 +2,15 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) [t1] diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe.LinqService).sql index 17d21aac7975..ab5c2d47f33a 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe.LinqService).sql @@ -4,15 +4,15 @@ DECLARE @n Int -- Int32 SET @n = 3 SELECT - [t1].[COUNT_1] + 4 as [Count4] + [t1].[Count4] + 4 as [Count4] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count4] FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) [t1] diff --git a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe.LinqService).sql index 5940b783128a..e129db5c7458 100644 --- a/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] as [Count6] + [t1].[Count6] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count6] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe.LinqService).sql index 5dd2af62d3ff..54f8d45ae793 100644 --- a/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe.LinqService).sql index 55d3f71dd854..c89fb8e4c5c6 100644 --- a/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[PersonID]) as [MAX_1] + MAX([t1].[PersonID]) as [Max_1] FROM [Person] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe.LinqService).sql index b687b86ed16c..2543eb4b6e02 100644 --- a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe.LinqService).sql index 9f70c593c58b..27cb81a0c68a 100644 --- a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([g_1].[Value1]) as [SUM_1], + SUM([g_1].[Value1]) as [Sum_1], SUM([g_1].[Value1]) as [c1] FROM [Parent] [g_1] diff --git a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe.LinqService).sql index f5cbadd08316..eb1ae54d8815 100644 --- a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([t1].[ParentID]) as [SUM_1] + SUM([t1].[ParentID]) as [Sum_1] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe.LinqService).sql index 38310200dbaf..cda250162504 100644 --- a/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] as [ChildCount] + [t1].[ChildCount] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ParentID] * [a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ParentID] * [a_Children].[ChildID]) as [ChildCount] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe.LinqService).sql index 4abd13dc34fc..6fc328b968ee 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM(Coalesce([a_Parent].[Value1], 0)) as [SUM_1] + SUM(Coalesce([a_Parent].[Value1], 0)) as [Sum_1] FROM [Child] [grp] LEFT JOIN [Parent] [a_Parent] ON [grp].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe.LinqService).sql index a7d3c68f6eab..69635ff2738d 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe.LinqService).sql @@ -2,11 +2,11 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1], - SUM([g_1].[ChildID]) as [SUM_1], - MIN([g_1].[ChildID]) as [MIN_1], - MAX([g_1].[ChildID]) as [MAX_1], - AVG([g_1].[ChildID]) as [AVG_1] + COUNT(*) as [Count_1], + SUM([g_1].[ChildID]) as [Sum_1], + MIN([g_1].[ChildID]) as [Min_1], + MAX([g_1].[ChildID]) as [Max_1], + AVG([g_1].[ChildID]) as [Average] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe.LinqService).sql index 2ffc12c468b8..55a7eba46254 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe.LinqService).sql @@ -2,11 +2,11 @@ -- SqlCe (asynchronously) SELECT - SUM([g_1].[ChildID]) as [SUM_1], - MIN([g_1].[ChildID]) as [MIN_1], - MAX([g_1].[ChildID]) as [MAX_1], - AVG([g_1].[ChildID]) as [AVG_1], - COUNT(*) as [COUNT_1] + SUM([g_1].[ChildID]) as [Sum_1], + MIN([g_1].[ChildID]) as [Min_1], + MAX([g_1].[ChildID]) as [Max_1], + AVG([g_1].[ChildID]) as [Average], + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe.LinqService).sql index a3fb69db3018..1564242aa6b9 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe.LinqService).sql @@ -5,23 +5,23 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 30 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], SUM(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [SUM_1], + END) as [Sum_1], MIN(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MAX(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [MAX_1], + END) as [Max_1], AVG(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [AVG_1] + END) as [Average] FROM [Child] [g_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe.LinqService).sql index bdfa3126765a..d0f03c65ed30 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe.LinqService).sql @@ -5,11 +5,11 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 30 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], SUM(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [SUM_1] + END) as [Sum_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe.LinqService).sql index d9b2cbada4f9..4103f927b280 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - AVG([t1].[ChildID]) as [AVG_1] + AVG([t1].[ChildID]) as [Average] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe.LinqService).sql index 64ba96beec24..ef51de23564b 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - AVG([c_1].[ChildID]) as [AVG_1] + AVG([c_1].[ChildID]) as [Average] FROM [Child] [c_1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe.LinqService).sql index 2e4cb25be259..77d4d8e31dae 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe.LinqService).sql @@ -3,27 +3,27 @@ SELECT [g_2].[Key_1], - [g_2].[AVG_1], - [g_2].[AVG_2], - [g_2].[AVG_3], - [g_2].[AVG_4], - [t2].[AVG_1] as [AVG_5], - [t4].[AVG_1] as [AVG_6], - [t6].[AVG_1] as [AVG_7] + [g_2].[Average], + [g_2].[Average_1], + [g_2].[Average_2], + [g_2].[Average_3], + [t2].[Average] as [Average_4], + [t4].[Average] as [Average_5], + [t6].[Average] as [Average_6] FROM ( SELECT [g_1].[GroupId] as [Key_1], - AVG([g_1].[DataValue]) as [AVG_1], - AVG([g_1].[DataValue]) as [AVG_2], + AVG([g_1].[DataValue]) as [Average], + AVG([g_1].[DataValue]) as [Average_1], AVG(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [AVG_3], + END) as [Average_2], AVG(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [AVG_4] + END) as [Average_3] FROM [AggregationData] [g_1] WHERE @@ -33,7 +33,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - AVG([t1].[DataValue]) as [AVG_1] + AVG([t1].[DataValue]) as [Average] FROM ( SELECT DISTINCT @@ -46,7 +46,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - AVG([t3].[DataValue]) as [AVG_1] + AVG([t3].[DataValue]) as [Average] FROM ( SELECT DISTINCT @@ -60,7 +60,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - AVG([t5].[DataValue]) as [AVG_1] + AVG([t5].[DataValue]) as [Average] FROM ( SELECT DISTINCT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe.LinqService).sql index 1a58d60aef85..d0c92250db27 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([c2].[ChildID]) as [SUM_1] + SUM([c2].[ChildID]) as [Sum_1] FROM [Child] [g_1] INNER JOIN [Child] [c2] ON [g_1].[ChildID] = [c2].[ChildID] + 1 diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe.LinqService).sql index 866985ef66c2..e9f993881c99 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [groupedData_1].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe.LinqService).sql index 7f40acbd8f44..cbbecef4dfe4 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe.LinqService).sql index f277348939c1..99875b508805 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe.LinqService).sql index 60057f3971c3..60685b89a369 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe.LinqService).sql index 888a92357b66..b509a1cca864 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe.LinqService).sql @@ -2,40 +2,40 @@ -- SqlCe (asynchronously) SELECT - [t9].[Key_1], - [t9].[COUNT_1], - [t9].[COUNT_2], - [t9].[COUNT_3], - [t2].[COUNT_1] as [COUNT_4], - [t3].[COUNT_1] as [COUNT_5], - [t5].[COUNT_1] as [COUNT_6], - [t6].[COUNT_1] as [COUNT_7], - [t9].[COUNT_4] as [COUNT_8], - [t8].[COUNT_1] as [COUNT_9] + [t11].[Key_1], + [t11].[Count_1], + [t11].[Count_2], + [t11].[Count_3], + [t2].[Count_1] as [Count_4], + [t4].[Count_1] as [Count_5], + [t6].[Count_1] as [Count_6], + [t8].[Count_1] as [Count_7], + [t11].[Count_4] as [Count_8], + [t10].[Count_1] as [Count_9] FROM ( SELECT [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(CASE WHEN CAST([t].[DataValue] AS Int) % 2 = 0 THEN 1 ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], + END) as [Count_2], + COUNT(*) as [Count_3], COUNT(CASE WHEN CAST([t].[DataValue] AS Int) % 2 = 0 THEN 1 ELSE NULL - END) as [COUNT_4] + END) as [Count_4] FROM [AggregationData] [t] WHERE [t].[DataValue] IS NOT NULL GROUP BY [t].[GroupId] - ) [t9] + ) [t11] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -43,12 +43,12 @@ FROM FROM [AggregationData] [t_1] WHERE - [t_1].[DataValue] IS NOT NULL AND [t9].[Key_1] = [t_1].[GroupId] + [t_1].[DataValue] IS NOT NULL AND [t11].[Key_1] = [t_1].[GroupId] ) [t1] ) [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -56,14 +56,13 @@ FROM FROM [AggregationData] [x] WHERE - [x].[DataValue] IS NOT NULL AND [t9].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - CAST([x_1].[DataValue] AS Int) % 2 = 0 - ) [t3] + [x].[DataValue] IS NOT NULL AND [t11].[Key_1] = [x].[GroupId] AND + CAST([x].[DataValue] AS Int) % 2 = 0 + ) [t3] + ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -71,29 +70,27 @@ FROM FROM [AggregationData] [t_2] WHERE - [t_2].[DataValue] IS NOT NULL AND [t9].[Key_1] = [t_2].[GroupId] AND + [t_2].[DataValue] IS NOT NULL AND [t11].[Key_1] = [t_2].[GroupId] AND CAST([t_2].[DataValue] AS Int) % 2 = 0 - ) [t4] - ) [t5] + ) [t5] + ) [t6] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT - [x_2].[DataValue] + [x_1].[DataValue] FROM - [AggregationData] [x_2] + [AggregationData] [x_1] WHERE - [x_2].[DataValue] IS NOT NULL AND [t9].[Key_1] = [x_2].[GroupId] AND - CAST([x_2].[DataValue] AS Int) % 2 = 0 - ) [x_3] - WHERE - CAST([x_3].[DataValue] AS Int) % 2 = 0 - ) [t6] + [x_1].[DataValue] IS NOT NULL AND [t11].[Key_1] = [x_1].[GroupId] AND + CAST([x_1].[DataValue] AS Int) % 2 = 0 + ) [t7] + ) [t8] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -101,10 +98,10 @@ FROM FROM [AggregationData] [t_3] WHERE - [t_3].[DataValue] IS NOT NULL AND [t9].[Key_1] = [t_3].[GroupId] AND + [t_3].[DataValue] IS NOT NULL AND [t11].[Key_1] = [t_3].[GroupId] AND CAST([t_3].[DataValue] AS Int) % 2 = 0 - ) [t7] - ) [t8] + ) [t9] + ) [t10] BeforeExecute -- SqlCe (asynchronously) diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe.LinqService).sql index 4d48311b0455..36998d06f101 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[Max_1]) as [SUM_1] + SUM([g_2].[Max_1]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe.LinqService).sql index 4d48311b0455..36998d06f101 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[Max_1]) as [SUM_1] + SUM([g_2].[Max_1]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe.LinqService).sql index 755022b7ec8d..ff14ad460e3c 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe.LinqService).sql index 747aa6ebc818..82a4fda90db1 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [g_2].[ChildId], [g_2].[ParentId], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe.LinqService).sql index b753390a0b06..9c954b6dfe9f 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [g_2].[ChildId], [g_2].[ParentId], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe.LinqService).sql index 4bc5d4850172..a8290b3baa9e 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe.LinqService).sql index 13626661d4b0..53e0b3ffa7a7 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe.LinqService).sql index 13626661d4b0..53e0b3ffa7a7 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe.LinqService).sql index c0e4384b33a3..bf126ee60b91 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], [grp_1].[Year_1], [grp_1].[Month_1] FROM diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe.LinqService).sql index c0e4384b33a3..bf126ee60b91 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], [grp_1].[Year_1], [grp_1].[Month_1] FROM diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe.LinqService).sql index b067bebdbc86..b41d754af761 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], DatePart(year, [grp_1].[Date_1]) as [Year_1], DatePart(month, [grp_1].[Date_1]) as [Month_1] FROM @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], DatePart(year, [grp_1].[Date_1]) as [Year_1], DatePart(month, [grp_1].[Date_1]) as [Month_1] FROM diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe.LinqService).sql index 9ebaf8e42250..4fb0492ca7a8 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [t1].[ChildID] as [Key_1], - AVG([t1].[ParentID]) as [AVG_1] + AVG([t1].[ParentID]) as [Average] FROM [Child] [t1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe.LinqService).sql index d23cb83251c4..77716ae5a5a2 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([g_1].[ParentID]) as [MAX_1] + MAX([g_1].[ParentID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe.LinqService).sql index 2087f023909d..98ff14e64c87 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe.LinqService).sql @@ -2,8 +2,8 @@ -- SqlCe (asynchronously) SELECT - MIN([gr].[ParentID]) as [MIN_1], - MAX([gr].[ParentID]) as [MAX_1] + MIN([gr].[ParentID]) as [Min_1], + MAX([gr].[ParentID]) as [Max_1] FROM [Parent] [gr] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe.LinqService).sql index b2cb138b1862..5a7f9d380911 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [t2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe.LinqService).sql index d6f1fe38ef05..9fe38e7681f3 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe.LinqService).sql @@ -3,11 +3,11 @@ SELECT [grp].[SiteID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(CASE WHEN [grp].[Active] = 0 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Issue1078Table] [grp] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe.LinqService).sql index be617c0e9f16..26d28ecd744a 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe.LinqService).sql @@ -5,7 +5,7 @@ SELECT TOP (1) COUNT(CASE WHEN [t].[Status] = 3 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Issue1192Table] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe.LinqService).sql index fca2d97a8eb3..c76a6d5393cd 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [t_1].[FinalCustomerId], [t_1].[IsActive], - SUM([t_1].[Amount]) as [SUM_1] + SUM([t_1].[Amount]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe.LinqService).sql index 51cff2e991a9..70cddc80418f 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_2].[cond], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe.LinqService).sql index 93c2fdbef7e5..f5de575b0a98 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe.LinqService).sql index ef864d0ee05c..28e1b51a17fa 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe.LinqService).sql index cbfd663bf2be..96bb76681701 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[ChildID]) as [MAX_1] + MAX([t1].[ChildID]) as [Max_1] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe.LinqService).sql index 46a7b21785a8..1c2d307de3cd 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe.LinqService).sql @@ -5,7 +5,7 @@ SELECT MAX(CASE WHEN [t1].[ChildID] > 20 THEN 1 ELSE 0 - END) as [MAX_1] + END) as [Max_1] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe.LinqService).sql index 46a7b21785a8..1c2d307de3cd 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe.LinqService).sql @@ -5,7 +5,7 @@ SELECT MAX(CASE WHEN [t1].[ChildID] > 20 THEN 1 ELSE 0 - END) as [MAX_1] + END) as [Max_1] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe.LinqService).sql index 4d2549e577a5..598998fe54c5 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([p].[ParentID]) as [MAX_1] + MAX([p].[ParentID]) as [Max_1] FROM [Parent] [p] INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe.LinqService).sql index 0a279e1e4879..daec3d433ddd 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([c_1].[ChildID]) as [MAX_1] + MAX([c_1].[ChildID]) as [Max_1] FROM [Child] [c_1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe.LinqService).sql index 80b4375cf8c5..c3b6791b06e9 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe.LinqService).sql @@ -3,27 +3,27 @@ SELECT [g_2].[GroupId], - [g_2].[MAX_1], - [g_2].[MAX_2], - [g_2].[MAX_3], - [g_2].[MAX_4], - [t2].[MAX_1] as [MAX_5], - [t4].[MAX_1] as [MAX_6], - [t6].[MAX_1] as [MAX_7] + [g_2].[Max_1], + [g_2].[Max_2], + [g_2].[Max_3], + [g_2].[Max_4], + [t2].[Max_1] as [Max_5], + [t4].[Max_1] as [Max_6], + [t6].[Max_1] as [Max_7] FROM ( SELECT [g_1].[GroupId], - MAX([g_1].[DataValue]) as [MAX_1], - MAX([g_1].[DataValue]) as [MAX_2], + MAX([g_1].[DataValue]) as [Max_1], + MAX([g_1].[DataValue]) as [Max_2], MAX(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MAX_3], + END) as [Max_3], MAX(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MAX_4] + END) as [Max_4] FROM [AggregationData] [g_1] GROUP BY @@ -31,7 +31,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - MAX([t1].[DataValue]) as [MAX_1] + MAX([t1].[DataValue]) as [Max_1] FROM ( SELECT DISTINCT @@ -44,7 +44,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - MAX([t3].[DataValue]) as [MAX_1] + MAX([t3].[DataValue]) as [Max_1] FROM ( SELECT DISTINCT @@ -57,7 +57,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - MAX([t5].[DataValue]) as [MAX_1] + MAX([t5].[DataValue]) as [Max_1] FROM ( SELECT DISTINCT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe.LinqService).sql index a0302ddb08d4..6776116837f2 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MIN([t1].[ChildID]) as [MIN_1] + MIN([t1].[ChildID]) as [Min_1] FROM [Child] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe.LinqService).sql index 3f17f569369c..649bf423c1eb 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MIN([c_1].[ChildID]) as [MIN_1] + MIN([c_1].[ChildID]) as [Min_1] FROM [Child] [c_1] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe.LinqService).sql index c95fe9aafcb1..b2e3602daf47 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe.LinqService).sql @@ -3,27 +3,27 @@ SELECT [g_2].[GroupId], - [g_2].[MIN_1], - [g_2].[MIN_2], - [g_2].[MIN_3], - [g_2].[MIN_4], - [t2].[MIN_1] as [MIN_5], - [t4].[MIN_1] as [MIN_6], - [t6].[MIN_1] as [MIN_7] + [g_2].[Min_1], + [g_2].[Min_2], + [g_2].[Min_3], + [g_2].[Min_4], + [t2].[Min_1] as [Min_5], + [t4].[Min_1] as [Min_6], + [t6].[Min_1] as [Min_7] FROM ( SELECT [g_1].[GroupId], - MIN([g_1].[DataValue]) as [MIN_1], - MIN([g_1].[DataValue]) as [MIN_2], + MIN([g_1].[DataValue]) as [Min_1], + MIN([g_1].[DataValue]) as [Min_2], MIN(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MIN_3], + END) as [Min_3], MIN(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MIN_4] + END) as [Min_4] FROM [AggregationData] [g_1] GROUP BY @@ -31,7 +31,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - MIN([t1].[DataValue]) as [MIN_1] + MIN([t1].[DataValue]) as [Min_1] FROM ( SELECT DISTINCT @@ -44,7 +44,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - MIN([t3].[DataValue]) as [MIN_1] + MIN([t3].[DataValue]) as [Min_1] FROM ( SELECT DISTINCT @@ -57,7 +57,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - MIN([t5].[DataValue]) as [MIN_1] + MIN([t5].[DataValue]) as [Min_1] FROM ( SELECT DISTINCT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe.LinqService).sql index 3e5f09c7a0d9..4d3df2610f0a 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([g_1].[ChildID]) as [MAX_1] + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe.LinqService).sql index 01b34bc2c5fb..40a9e95962ed 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([g_1].[ParentID]) as [MAX_1] + MAX([g_1].[ParentID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe.LinqService).sql index d5f7bf10d5d7..7f316fb3e89c 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([g_1].[ChildID]) as [MAX_1] + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe.LinqService).sql index f8bbe8e02ab9..2771f4044978 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe.LinqService).sql index f8bbe8e02ab9..2771f4044978 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe.LinqService).sql index f8bbe8e02ab9..2771f4044978 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe.LinqService).sql index 5f3006276082..dbbf3126ad07 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_2].[n], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe.LinqService).sql index 646179d10394..c3b9863af85e 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Child] [g_1] LEFT JOIN [Parent] [p] ON [g_1].[ParentID] = [p].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe.LinqService).sql index 9b543586cbfa..32f82099242d 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([g_1].[ChildID]) as [SUM_1] + SUM([g_1].[ChildID]) as [Sum_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe.LinqService).sql index 9b543586cbfa..32f82099242d 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - SUM([g_1].[ChildID]) as [SUM_1] + SUM([g_1].[ChildID]) as [Sum_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe.LinqService).sql index 198037154ca8..c1b23c1925ae 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM ( SELECT @@ -16,7 +16,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe.LinqService).sql index 276e6eb4465d..2f996cc956a4 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe.LinqService).sql @@ -3,27 +3,27 @@ SELECT [g_2].[GroupId], - [g_2].[SUM_1], - [g_2].[SUM_2], - [g_2].[SUM_3], - [g_2].[SUM_4], - [t2].[SUM_1] as [SUM_5], - [t4].[SUM_1] as [SUM_6], - [t6].[SUM_1] as [SUM_7] + [g_2].[Sum_1], + [g_2].[Sum_2], + [g_2].[Sum_3], + [g_2].[Sum_4], + [t2].[Sum_1] as [Sum_5], + [t4].[Sum_1] as [Sum_6], + [t6].[Sum_1] as [Sum_7] FROM ( SELECT [g_1].[GroupId], - SUM([g_1].[DataValue]) as [SUM_1], - SUM([g_1].[DataValue]) as [SUM_2], + SUM([g_1].[DataValue]) as [Sum_1], + SUM([g_1].[DataValue]) as [Sum_2], SUM(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [SUM_3], + END) as [Sum_3], SUM(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [SUM_4] + END) as [Sum_4] FROM [AggregationData] [g_1] GROUP BY @@ -31,7 +31,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - SUM([t1].[DataValue]) as [SUM_1] + SUM([t1].[DataValue]) as [Sum_1] FROM ( SELECT DISTINCT @@ -44,7 +44,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - SUM([t3].[DataValue]) as [SUM_1] + SUM([t3].[DataValue]) as [Sum_1] FROM ( SELECT DISTINCT @@ -57,7 +57,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - SUM([t5].[DataValue]) as [SUM_1] + SUM([t5].[DataValue]) as [Sum_1] FROM ( SELECT DISTINCT diff --git a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe.LinqService).sql index 44cfdf4742b0..e2b86ac95fa2 100644 --- a/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @n Int -- Int32 SET @n = 1 SELECT - SUM([g_2].[ParentID] - 3) as [SUM_1] + SUM([g_2].[ParentID] - 3) as [Sum_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe.LinqService).sql index 48625868edbd..30e761bee9f0 100644 --- a/SqlCe.LinqService/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [gr] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,2).sql b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,2).sql index 6d79f566dfe4..14030cc9df67 100644 --- a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,2).sql +++ b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,2).sql @@ -4,7 +4,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,4).sql b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,4).sql index f0895a26f806..82899d1a68bf 100644 --- a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,4).sql +++ b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,4).sql @@ -4,7 +4,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,null).sql b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,null).sql index ebafc1de944e..999927f2d09b 100644 --- a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,null).sql +++ b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe.LinqService,null).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -10,7 +10,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,abc).sql b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,abc).sql index 198251a972f6..8024cf2b6888 100644 --- a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,abc).sql +++ b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,abc).sql @@ -4,7 +4,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,null).sql b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,null).sql index c1ee09cce213..c09a6a92e02d 100644 --- a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,null).sql +++ b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,null).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,xyz).sql b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,xyz).sql index 02ccc9e3dff8..11a6548cb0d4 100644 --- a/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,xyz).sql +++ b/SqlCe.LinqService/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe.LinqService,xyz).sql @@ -4,7 +4,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe.LinqService).sql index 0562d0368d56..00aba84f9d85 100644 --- a/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] INNER JOIN [GrandChild] [y] ON [g_1].[ParentID] = [y].[ParentID] AND [g_1].[ChildID] = [y].[ChildID] diff --git a/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe.LinqService).sql index 85bb3f2407a2..2fd4f235ad8f 100644 --- a/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [c_1].[ChildID], [c_1].[ParentID], - [t1].[COUNT_1], + [t1].[Count_1], CASE WHEN EXISTS( SELECT @@ -29,13 +29,13 @@ SELECT THEN 1 ELSE 0 END as [AllChildren], - [t2].[MIN_1], - [t3].[MAX_1] + [t2].[Min_1], + [t3].[Max_1] FROM [Child] [c_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c2] WHERE @@ -43,7 +43,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - MIN([c2_1].[ChildID]) as [MIN_1] + MIN([c2_1].[ChildID]) as [Min_1] FROM [Child] [c2_1] WHERE @@ -51,7 +51,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - MAX([c2_2].[ChildID]) as [MAX_1] + MAX([c2_2].[ChildID]) as [Max_1] FROM [Child] [c2_2] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe.LinqService).sql index 996822a4fe91..f2646c02157a 100644 --- a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe.LinqService).sql @@ -3,7 +3,7 @@ SELECT [b_1].[Date_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe.LinqService).sql index 678868063ab3..50f9a123a3b9 100644 --- a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe.LinqService).sql @@ -2,14 +2,14 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t2].[ChildID] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [ch] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe.LinqService).sql index 631000aa3e01..5322bfb72f3b 100644 --- a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe.LinqService).sql index f6985fb767c9..0db423e69f20 100644 --- a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe.LinqService).sql index c1a84fef1425..dad76e4bac9f 100644 --- a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe.LinqService).sql @@ -5,12 +5,12 @@ SET @n = 1 SELECT [p].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe.LinqService).sql index 74e78d7b86b8..a0311e9d2598 100644 --- a/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe.LinqService).sql @@ -3,12 +3,12 @@ SELECT [p].[ParentID], - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([c_1].[ChildID]) as [SUM_1] + SUM([c_1].[ChildID]) as [Sum_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe.LinqService).sql index f4e1bebc32cb..af8bbe568bb9 100644 --- a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe.LinqService).sql @@ -18,14 +18,14 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe.LinqService).sql index f4e1bebc32cb..af8bbe568bb9 100644 --- a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe.LinqService).sql @@ -18,14 +18,14 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe.LinqService).sql index 1d68a9e91c5e..6d3ee693accb 100644 --- a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe.LinqService).sql @@ -51,14 +51,14 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe.LinqService).sql index 0d779043ec8b..c4141f5c54cc 100644 --- a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe.LinqService).sql @@ -21,14 +21,14 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[ChildID] FROM [Child] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe.LinqService).sql index f4e1bebc32cb..af8bbe568bb9 100644 --- a/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe.LinqService).sql @@ -18,14 +18,14 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe.LinqService).sql index 54a494e3bc8e..4df989365113 100644 --- a/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe.LinqService).sql index 1653c8e01a96..7dc3b3853f48 100644 --- a/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe.LinqService).sql index 045b5b819519..58518a32bd7c 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe.LinqService).sql @@ -2,13 +2,18 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (CAST(FLOOR([p].[MoneyValue]) AS Int) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (CAST(FLOOR([t].[MoneyValue]) AS Int) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe.LinqService).sql index 80fcfc608fa8..1dacc90d313b 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe.LinqService).sql index 8eacbd41922e..700e7238630f 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe.LinqService).sql @@ -2,13 +2,18 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,1).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,1).sql index fd90d47e4cbe..0159b81e4fc6 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,1).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,2).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,2).sql index fd90d47e4cbe..0159b81e4fc6 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,2).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,1).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,1).sql index 80fcfc608fa8..1dacc90d313b 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,1).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,2).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,2).sql index 80fcfc608fa8..1dacc90d313b 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,2).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe.LinqService).sql index ffc93a05297b..4313c10e54e3 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe.LinqService).sql @@ -2,13 +2,18 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([p].[MoneyValue] AS Float)) AS Int) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([t].[MoneyValue] AS Float)) AS Int) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe.LinqService).sql index 80fcfc608fa8..1dacc90d313b 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe.LinqService).sql index 8eacbd41922e..700e7238630f 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe.LinqService).sql @@ -2,13 +2,18 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe.LinqService).sql index b14a7a7f1096..0342e6b96113 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe.LinqService).sql @@ -2,9 +2,14 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe.LinqService).sql index b708b368a57c..449dd2e3d1f7 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe.LinqService).sql @@ -2,9 +2,14 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe.LinqService).sql index 045b5b819519..58518a32bd7c 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe.LinqService).sql @@ -2,13 +2,18 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (CAST(FLOOR([p].[MoneyValue]) AS Int) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (CAST(FLOOR([t].[MoneyValue]) AS Int) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe.LinqService).sql index ffc93a05297b..4313c10e54e3 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe.LinqService).sql @@ -2,13 +2,18 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([p].[MoneyValue] AS Float)) AS Int) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([t].[MoneyValue] AS Float)) AS Int) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe.LinqService).sql index 6c0bd6297ca8..b173a2258b49 100644 --- a/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe.LinqService).sql @@ -2,9 +2,14 @@ -- SqlCe (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe.LinqService).sql index a2b0b2d7163c..5234052b04e3 100644 --- a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe.LinqService).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlCe (asynchronously) @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlCe (asynchronously) @@ -78,9 +78,9 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -88,9 +88,9 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlCe (asynchronously) @@ -109,21 +109,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -142,21 +142,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -172,19 +172,19 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe.LinqService).sql index a2b0b2d7163c..5234052b04e3 100644 --- a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe.LinqService).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlCe (asynchronously) @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlCe (asynchronously) @@ -78,9 +78,9 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -88,9 +88,9 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlCe (asynchronously) @@ -109,21 +109,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -142,21 +142,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -172,19 +172,19 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe.LinqService).sql index 4c69c4754a89..cbad309dea42 100644 --- a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe.LinqService).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -78,21 +78,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlCe (asynchronously) @@ -111,21 +111,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -144,21 +144,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -174,19 +174,19 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe.LinqService).sql index 4c69c4754a89..cbad309dea42 100644 --- a/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe.LinqService).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -78,21 +78,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlCe (asynchronously) @@ -111,21 +111,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -144,21 +144,21 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe (asynchronously) @@ -174,19 +174,19 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlCe.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe.LinqService).sql index 0467a3c6e689..125cd7e01926 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe.LinqService).sql @@ -5,7 +5,7 @@ SET @take = 2 SELECT [t_1].[DuplicateData], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT TOP (@take) @@ -16,7 +16,7 @@ FROM ) [t_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [OrderByDistinctData] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe.LinqService).sql index 3aab68e247a7..6a20791d4d67 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe.LinqService).sql index 2bb4e5d32bec..6b233fbb75b9 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 3 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe.LinqService).sql index f874c8f5475b..b73239883cfc 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MIN([t1].[ParentID]) as [MIN_1] + MIN([t1].[ParentID]) as [Min_1] FROM [Parent] [t1] diff --git a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe.LinqService).sql index caadf297023f..8b47e1c9b379 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 3 SELECT - MIN([t2].[ParentID]) as [MIN_1] + MIN([t2].[ParentID]) as [Min_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe.LinqService).sql index 4c4faaf4a907..58c42538a0f7 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 3 SELECT - MIN([t2].[ParentID]) as [MIN_1] + MIN([t2].[ParentID]) as [Min_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe.LinqService).sql index d07c5b9833e2..e20ccb47aeaf 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe.LinqService).sql @@ -4,9 +4,9 @@ DECLARE @take Int -- Int32 SET @take = 1 SELECT TOP (@take) - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], 1 + MIN([g_1].[ChildID]) as [c1], - MAX([g_1].[ChildID]) as [MAX_1] + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] diff --git a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe.LinqService).sql index 4bf34adf5e74..9b35bcc16b11 100644 --- a/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe.LinqService).sql @@ -8,7 +8,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -17,5 +17,5 @@ FROM INNER JOIN [Parent] [pp] ON [p].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe.LinqService).sql index 690de686d3f4..93380004ce3f 100644 --- a/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @id Int -- Int32 SET @id = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe.LinqService).sql index c0626126d48f..c488645368a5 100644 --- a/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE @@ -14,7 +14,7 @@ DECLARE @id Int -- Int32 SET @id = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,False).sql index c768ecdcd31a..1c3084ce5af5 100644 --- a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -23,7 +23,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -35,8 +35,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -44,8 +44,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -76,7 +76,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -88,8 +88,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -97,8 +97,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -129,7 +129,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -140,8 +140,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -172,7 +172,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -183,8 +183,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -215,7 +215,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -231,16 +231,16 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -274,7 +274,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -290,16 +290,16 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -333,7 +333,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -348,8 +348,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -383,7 +383,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -398,8 +398,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -433,7 +433,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -445,8 +445,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -454,8 +454,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -463,8 +463,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -495,7 +495,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -507,8 +507,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -516,8 +516,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -525,8 +525,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -557,7 +557,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -568,13 +568,13 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -605,7 +605,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -616,13 +616,13 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -653,7 +653,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -669,24 +669,24 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -720,7 +720,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -736,24 +736,24 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -787,7 +787,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -802,12 +802,12 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -841,7 +841,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -856,12 +856,12 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -895,14 +895,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -931,14 +931,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -967,14 +967,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1003,14 +1003,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1039,14 +1039,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1075,14 +1075,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1111,14 +1111,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1147,14 +1147,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1183,7 +1183,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1194,7 +1194,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1226,7 +1226,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1237,7 +1237,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1269,7 +1269,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1280,7 +1280,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1312,7 +1312,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1323,7 +1323,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1355,7 +1355,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1366,7 +1366,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1398,7 +1398,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1409,7 +1409,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1441,7 +1441,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1452,7 +1452,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1484,7 +1484,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1495,7 +1495,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END diff --git a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,True).sql index c768ecdcd31a..1c3084ce5af5 100644 --- a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe.LinqService,True).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -23,7 +23,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -35,8 +35,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -44,8 +44,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -76,7 +76,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -88,8 +88,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -97,8 +97,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -129,7 +129,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -140,8 +140,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -172,7 +172,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -183,8 +183,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -215,7 +215,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -231,16 +231,16 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -274,7 +274,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -290,16 +290,16 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -333,7 +333,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -348,8 +348,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -383,7 +383,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -398,8 +398,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -433,7 +433,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -445,8 +445,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -454,8 +454,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -463,8 +463,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -495,7 +495,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -507,8 +507,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -516,8 +516,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -525,8 +525,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -557,7 +557,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -568,13 +568,13 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -605,7 +605,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -616,13 +616,13 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -653,7 +653,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -669,24 +669,24 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -720,7 +720,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -736,24 +736,24 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -787,7 +787,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -802,12 +802,12 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -841,7 +841,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -856,12 +856,12 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -895,14 +895,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -931,14 +931,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -967,14 +967,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1003,14 +1003,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1039,14 +1039,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1075,14 +1075,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1111,14 +1111,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1147,14 +1147,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe (asynchronously) @@ -1183,7 +1183,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1194,7 +1194,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1226,7 +1226,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1237,7 +1237,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1269,7 +1269,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1280,7 +1280,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1312,7 +1312,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1323,7 +1323,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1355,7 +1355,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1366,7 +1366,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1398,7 +1398,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1409,7 +1409,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1441,7 +1441,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1452,7 +1452,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1484,7 +1484,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1495,7 +1495,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END diff --git a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,False).sql index eec1d9073c0b..17caa0326caa 100644 --- a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,False).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -34,7 +34,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -65,7 +65,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -96,7 +96,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -127,7 +127,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -158,7 +158,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -189,7 +189,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -221,7 +221,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -253,7 +253,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -284,7 +284,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -315,7 +315,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -346,7 +346,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -377,7 +377,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -408,7 +408,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -440,7 +440,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -471,7 +471,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -502,7 +502,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -533,7 +533,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -564,7 +564,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -595,7 +595,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -627,7 +627,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -658,7 +658,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -689,7 +689,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -720,7 +720,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,True).sql index eec1d9073c0b..17caa0326caa 100644 --- a/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe.LinqService,True).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -34,7 +34,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -65,7 +65,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -96,7 +96,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -127,7 +127,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -158,7 +158,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -189,7 +189,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -221,7 +221,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -253,7 +253,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -284,7 +284,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -315,7 +315,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -346,7 +346,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -377,7 +377,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -408,7 +408,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -440,7 +440,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -471,7 +471,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -502,7 +502,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -533,7 +533,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -564,7 +564,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -595,7 +595,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -627,7 +627,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -658,7 +658,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -689,7 +689,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -720,7 +720,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe.LinqService).sql index b91bdaa000ae..7f4d056f10ec 100644 --- a/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT TOP (@take) [a_Patient].[Diagnosis], [a_Patient].[PersonID], - AVG([auto16031].[PersonID]) as [AVG_1] + AVG([auto16031].[PersonID]) as [Average] FROM [Person] [auto16031] LEFT JOIN [Patient] [a_Patient] ON [auto16031].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe.LinqService).sql index 693540c0e887..bf198253fc09 100644 --- a/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT TOP (@take) [a_Patient].[Diagnosis], [a_Patient].[PersonID] as [id], - AVG([auto16031].[PersonID]) as [AVG_1] + AVG([auto16031].[PersonID]) as [Average] FROM [Person] [auto16031] LEFT JOIN [Patient] [a_Patient] ON [auto16031].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe.LinqService).sql index b91bdaa000ae..7f4d056f10ec 100644 --- a/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe.LinqService).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT TOP (@take) [a_Patient].[Diagnosis], [a_Patient].[PersonID], - AVG([auto16031].[PersonID]) as [AVG_1] + AVG([auto16031].[PersonID]) as [Average] FROM [Person] [auto16031] LEFT JOIN [Patient] [a_Patient] ON [auto16031].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe.LinqService).sql index 978969a060b1..166b6e4b98a6 100644 --- a/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] LEFT JOIN [Child] [c_1] ON [t1].[ParentID] = [c_1].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe.LinqService).sql index 1f3bdeb70389..8b94607bb210 100644 --- a/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] INNER JOIN [GrandChild] [g_1] ON [t1].[ParentID] = [g_1].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe.LinqService).sql index 4356e6529032..66a8e4adf174 100644 --- a/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] INNER JOIN [GrandChild] [g_1] ON [t1].[ParentID] = [g_1].[ParentID] diff --git a/SqlCe.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe.LinqService).sql index 4ee607fec9e3..71a02a851850 100644 --- a/SqlCe.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [a] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe.LinqService).sql index 077e79cb0262..fa01c8d23ae5 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -43,7 +43,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -54,7 +54,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -65,7 +65,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -75,7 +75,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -86,7 +86,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -97,7 +97,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,1).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,1).sql index 9086a2dbd1b2..e1609c65f9ba 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,1).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,1).sql @@ -4,7 +4,7 @@ DECLARE @r3 Int -- Int32 SET @r3 = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,2).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,2).sql index eafe557ab334..d0c4c1a5b0b0 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,2).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,2).sql @@ -4,7 +4,7 @@ DECLARE @r3 Int -- Int32 SET @r3 = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,3).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,3).sql index 8581b82f9f9b..fc88cf7c6849 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,3).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe.LinqService,3).sql @@ -4,7 +4,7 @@ DECLARE @r3 Int -- Int32 SET @r3 = 3 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe.LinqService).sql index 0a4034eed3ac..df074df003a6 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe.LinqService).sql index 903b0ee10e68..111083512cf9 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe.LinqService).sql index 14cee57df923..3ee158ac191b 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe.LinqService).sql index 564d51919be5..dd4430b5402d 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe.LinqService).sql index 6e89847b6beb..5e99a29d9ad9 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] @@ -10,7 +10,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe.LinqService).sql index b10ef478e61c..811b9fb318f0 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe.LinqService).sql index ee84194613d1..3ff7408ae60c 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe.LinqService).sql index b7e003677f90..81f4907c6c1f 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe.LinqService).sql index 4d40822abac2..e80d5efffbcb 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Mixed] [t] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe.LinqService).sql index 6a75f6332776..026b414713f0 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -52,7 +52,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -62,7 +62,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -72,7 +72,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -82,7 +82,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -92,7 +92,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe.LinqService).sql index dd151323d9af..59364d3908ca 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe.LinqService).sql index ca75259de494..3e2cb7b160e1 100644 --- a/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -48,7 +48,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe.LinqService).sql index 7d043e009ac2..6a1eb7647bd1 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe.LinqService).sql index 8822f8321da3..2b5de74406f4 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe.LinqService).sql index fd962cfb3939..c9bfb8d1a1f6 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe.LinqService).sql index 6f885af275a2..484d7726c50b 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @s NVarChar(7) -- String SET @s = '123[456' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -16,7 +16,7 @@ DECLARE @s NVarChar(7) -- String SET @s = '123[456' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe.LinqService).sql index 54ef8b0edd3e..d14ee290fe93 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe.LinqService).sql @@ -6,7 +6,7 @@ DECLARE @ps NVarChar(3) -- String SET @ps = '%[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe.LinqService).sql index 043e966e1acc..a4c64e8a5224 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe.LinqService).sql index e739ee90a73e..6afe1a855893 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ DECLARE @ps NVarChar(3) -- String SET @ps = '%[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,#).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,#).sql index 6b6f7013300d..378352fe1a1f 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,#).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,#).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%#%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,%).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,%).sql index 617ce639d48d..4ccc5e46ac7e 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,%).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,%).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%~%%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,-).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,-).sql index de778c811202..f1bb030b9e16 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,-).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,-).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%-%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x002A).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x002A).sql index 76626343965a..7aba3abdba14 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x002A).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x002A).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%*%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x003F).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x003F).sql index 2b92389633e5..e679a9373310 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x003F).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,0x003F).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%?%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[).sql index 4be0c41789fc..11abdd530b94 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[[).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[[).sql index 2d02d9ecb665..1c16af5c6b2b 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[[).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[[).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%[[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[]).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[]).sql index fb97841e1cd0..cec5cb414132 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[]).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,[]).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%[]%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]).sql index 65e7b5b5e2fe..eb922b41b9d5 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%]%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]]).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]]).sql index cbead6b17f85..58b528d340d6 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]]).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,]]).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%]]%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,n).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,n).sql index 402f152ad5f3..e3039bb61df3 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,n).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe.LinqService,n).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%n%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,#).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,#).sql index 0c84756cf7d2..4444cd34c22a 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,#).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,#).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,%).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,%).sql index cc1d80935409..cee56a97642c 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,%).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,%).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,-).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,-).sql index 5deaffd49758..98ccad8a506f 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,-).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,-).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x002A).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x002A).sql index 04f89d33e8b3..fd6e60f3ae44 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x002A).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x002A).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x003F).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x003F).sql index 4cf1db64d000..b5cc80fecde8 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x003F).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,0x003F).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[).sql index 9fcb23bf0c37..b558ff5e931b 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[[).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[[).sql index fabb8eef7054..184720a7d77b 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[[).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[[).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[]).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[]).sql index 7006516099a2..b073a50940d1 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[]).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,[]).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]).sql index 9f7d240b646d..a4befa207003 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]]).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]]).sql index 42026db2aed2..38080c2f9740 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]]).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,]]).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,n).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,n).sql index c24f25f3ff29..53da1f0e11d3 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,n).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe.LinqService,n).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe.LinqService).sql index 9b2407782a6b..924c6111323a 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe.LinqService).sql index d021e26eadba..4581ddeef9ea 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe.LinqService).sql index 886a6acb6fdd..281b3f1d77e9 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe.LinqService).sql index cd1bb897f0b1..06a7692e9ffe 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe.LinqService).sql index ba3aa53195c7..dcaaa69e5ec1 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE @@ -13,7 +13,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE @@ -35,7 +35,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe.LinqService).sql index 9b2407782a6b..924c6111323a 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe.LinqService).sql index d021e26eadba..4581ddeef9ea 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe.LinqService).sql index 886a6acb6fdd..281b3f1d77e9 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe.LinqService).sql index a48c8516cda8..c52b70409806 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe.LinqService).sql index 62e78377f64d..e30eeba19039 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe.LinqService).sql index 1f3a419f0f58..612b1bc52ae9 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe.LinqService).sql index c542c18135b3..ff11e283fc67 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe.LinqService).sql index 0836d03cf5ea..621813d9c963 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe.LinqService).sql @@ -59,7 +59,7 @@ DECLARE @test_1 NVarChar(6) -- String SET @test_1 = '%Test%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SampleClass] [sampleClass_1] WHERE @@ -94,7 +94,7 @@ DECLARE @test_1 NVarChar(7) -- String SET @test_1 = '%Value%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SampleClass] [sampleClass_1] WHERE @@ -129,7 +129,7 @@ DECLARE @test_1 NVarChar(7) -- String SET @test_1 = '%Class%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SampleClass] [sampleClass_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe.LinqService).sql index 247bd76ae7e0..c513bded3577 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -13,7 +13,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe.LinqService).sql index 09cd252df68c..7d610b5c5220 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCulture).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCulture).sql index 1657a8c943d8..b5fb3c5558f4 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCulture).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCulture).sql @@ -16,7 +16,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -31,7 +31,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -61,7 +61,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCultureIgnoreCase).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCultureIgnoreCase).sql index 200fc5d2fae0..42aa1677a0d5 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCultureIgnoreCase).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,InvariantCultureIgnoreCase).sql @@ -14,7 +14,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -26,7 +26,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,Ordinal).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,Ordinal).sql index 1657a8c943d8..b5fb3c5558f4 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,Ordinal).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,Ordinal).sql @@ -16,7 +16,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -31,7 +31,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -61,7 +61,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,OrdinalIgnoreCase).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,OrdinalIgnoreCase).sql index 200fc5d2fae0..42aa1677a0d5 100644 --- a/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,OrdinalIgnoreCase).sql +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe.LinqService,OrdinalIgnoreCase).sql @@ -14,7 +14,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -26,7 +26,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlCe.LinqService).sql new file mode 100644 index 000000000000..5938b4b33e67 --- /dev/null +++ b/SqlCe.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlCe.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlCe (asynchronously) + +SELECT + Coalesce([t].[Value2], '') as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlCe (asynchronously) + +SELECT + Coalesce([t].[Value3], '') as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlCe (asynchronously) + +SELECT + SUBSTRING(Coalesce(' -> ' + [t].[Value3], '') + Coalesce(' -> ' + [t].[Value1], '') + Coalesce(' -> ' + [t].[Value2], ''), 5, 2147483647) as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlCe (asynchronously) + +SELECT + SUBSTRING(Coalesce(' -> ' + [t].[Value3], '') + Coalesce(' -> ' + [t].[Value3], ''), 5, 2147483647) as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe.LinqService).sql index dde068f6087a..86d758ddaf04 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + * FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( + [m_1].[Id] = [a_Lines].[TransactionId] AND EXISTS( SELECT * FROM - [LineEntity] [a_Lines] + ( + SELECT 'A' AS [item] + UNION ALL + SELECT 'B' AS [item]) [t1] WHERE - [x].[Id] = [a_Lines].[TransactionId] AND EXISTS( - SELECT - * - FROM - ( - SELECT 'A' AS [item] - UNION ALL - SELECT 'B' AS [item]) [t1] - WHERE - [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL - ) + [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + ) BeforeExecute -- SqlCe (asynchronously) diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe.LinqService).sql index df342decdc72..756b59adb047 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe.LinqService).sql @@ -7,32 +7,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + * FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( + [m_1].[Id] = [a_Lines].[TransactionId] AND EXISTS( SELECT * FROM - [LineEntity] [a_Lines] + ( + SELECT 'A' AS [item] + UNION ALL + SELECT 'B' AS [item]) [t1] WHERE - [x].[Id] = [a_Lines].[TransactionId] AND EXISTS( - SELECT - * - FROM - ( - SELECT 'A' AS [item] - UNION ALL - SELECT 'B' AS [item]) [t1] - WHERE - [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL - ) + [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + ) BeforeExecute -- SqlCe (asynchronously) diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe.LinqService).sql index f00918304475..1ead25aee74a 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe.LinqService).sql @@ -59,7 +59,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe.LinqService).sql index 068ac1c4ca02..1a4bcdc9d782 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe.LinqService).sql index ec864f91e181..2682b0f14fc0 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe.LinqService).sql index 1fe8ebd18851..41721f592261 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] INNER JOIN [GrandChild] [g_1] ON [a_Children].[ParentID] = [g_1].[ParentID] AND [a_Children].[ChildID] = [g_1].[ChildID] diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe.LinqService).sql index 86e94b5b0dcb..0d1ca8b25299 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe.LinqService).sql @@ -2,13 +2,13 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Child] [p1] LEFT JOIN [Parent] [a_Parent] ON [p1].[ParentID] = [a_Parent].[ParentID] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe.LinqService).sql index da237e8ea4cf..19276792395f 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[MAX_1] + [t1].[Max_1] FROM [Parent] [p] OUTER APPLY ( SELECT - MAX([ch].[ChildID]) as [MAX_1] + MAX([ch].[ChildID]) as [Max_1] FROM [Child] [ch] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe.LinqService).sql index 614f9d953d58..4f5360694aee 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[MAX_1] + [t1].[Max_1] FROM [Parent] [p] OUTER APPLY ( SELECT - MAX([ch].[ChildID]) as [MAX_1] + MAX([ch].[ChildID]) as [Max_1] FROM [Child] [ch] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe.LinqService).sql index 4cab40f389b8..a76343b525eb 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe.LinqService).sql @@ -5,8 +5,8 @@ SET @testValue = 3 SELECT [id_1].[c1], - [t1].[COUNT_1], - [t2].[COUNT_1] as [COUNT_2] + [t1].[Count_1], + [t2].[Count_1] as [Count_2] FROM ( SELECT DISTINCT @@ -21,7 +21,7 @@ FROM ) [id_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [p] WHERE @@ -29,7 +29,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [p_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe.LinqService).sql index d1be146b0bff..e08009d2333e 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe.LinqService).sql @@ -6,13 +6,13 @@ SET @id = 2 SELECT [c_1].[ChildID], [c_1].[ParentID], - [t1].[SUM_1], - [t2].[COUNT_1] + [t1].[Sum_1], + [t2].[Count_1] FROM [Child] [c_1] OUTER APPLY ( SELECT - SUM([g_1].[ChildID] * [g_1].[GrandChildID]) as [SUM_1] + SUM([g_1].[ChildID] * [g_1].[GrandChildID]) as [Sum_1] FROM [GrandChild] [g_1] WHERE @@ -20,7 +20,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_2] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe.LinqService).sql index 2069b57373ac..e9d11a36aaee 100644 --- a/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Child] [c_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_1] WHERE diff --git a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,False).sql index 9fd4a4be1d0b..6f02697ac3c3 100644 --- a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,True).sql index 9146d38c50d1..a72c4279ad6e 100644 --- a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe.LinqService,True).sql @@ -4,7 +4,7 @@ DECLARE @skip Int -- Int32 SET @skip = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,False).sql b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,False).sql index 24eff58476c6..f6d5ef690da5 100644 --- a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,False).sql +++ b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,False).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT TOP (5) diff --git a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,True).sql b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,True).sql index 20c71ac4c94d..5be5650101d4 100644 --- a/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,True).sql +++ b/SqlCe.LinqService/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe.LinqService,True).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 5 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe.LinqService).sql index 1d4ab1a71052..6348963df7c2 100644 --- a/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [a_Person].[personid], [a_Person].[personname], - MAX([VBIt].[added]) as [MAX_1] + MAX([VBIt].[added]) as [Max_1] FROM [activity649] [VBIt] INNER JOIN [person649] [a_Person] ON [VBIt].[personid] = [a_Person].[personid] diff --git a/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe.LinqService).sql index 5d8142208a2c..54577d5d272f 100644 --- a/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [a_Person].[personid], [a_Person].[personname], - MAX([f].[added]) as [MAX_1] + MAX([f].[added]) as [Max_1] FROM [activity649] [f] INNER JOIN [person649] [a_Person] ON [f].[personid] = [a_Person].[personid] diff --git a/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe.LinqService).sql index a1bed6a13a83..8f22a6c1c61c 100644 --- a/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe.LinqService).sql @@ -4,7 +4,7 @@ SELECT [data_1].[ParentID], [data_1].[ChildID], - MAX([data_1].[ChildID]) as [MAX_1] + MAX([data_1].[ChildID]) as [Max_1] FROM [Child] [data_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe.LinqService).sql index 5345aa71b321..7c5405217acf 100644 --- a/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe.LinqService).sql index 213a0c5f85f6..7678ae6c782f 100644 --- a/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe.LinqService).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe.LinqService).sql index 9cbed2a5aec6..0f63f17656dd 100644 --- a/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe.LinqService).sql @@ -11,7 +11,7 @@ FROM [WithMultipleDates] [p] OUTER APPLY ( SELECT - MAX([t1].[item]) as [MAX_1] + MAX([t1].[item]) as [Max_1] FROM ( SELECT [p].[Date1] AS [item] @@ -23,7 +23,7 @@ FROM SELECT [p].[Date4] AS [item]) [t1] ) [t2] WHERE - [t2].[MAX_1] > CAST('2023-01-01' AS DateTime) + [t2].[Max_1] > CAST('2023-01-01' AS DateTime) BeforeExecute -- SqlCe (asynchronously) @@ -38,7 +38,7 @@ FROM [WithMultipleDates] [p] OUTER APPLY ( SELECT - MAX([t1].[item]) as [MAX_1] + MAX([t1].[item]) as [Max_1] FROM ( SELECT [p].[Date1] AS [item] @@ -50,6 +50,6 @@ FROM SELECT [p].[Date4] AS [item]) [t1] ) [t2] WHERE - [t2].[MAX_1] <= [p].[Date1] OR [t2].[MAX_1] IS NULL OR + [t2].[Max_1] <= [p].[Date1] OR [t2].[Max_1] IS NULL OR [p].[Date1] IS NULL diff --git a/SqlCe.LinqService/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe.LinqService).sql index b507f38212c0..6ca133055b7f 100644 --- a/SqlCe.LinqService/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [InstanceClass] [t] diff --git a/SqlCe.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlCe.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index bd4cb231b3ab..d39b77a67f4a 100644 --- a/SqlCe.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlCe.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB] as [LB], [d].[ValInt] as [LI] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlCe (asynchronously) diff --git a/SqlCe.LinqService/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe.LinqService).sql index cc5fc85cc695..0b988349ca46 100644 --- a/SqlCe.LinqService/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe.LinqService).sql @@ -21,7 +21,7 @@ BeforeExecute SELECT [g_2].[Field6], [g_2].[Field4], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT diff --git a/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe.LinqService).sql index 902617723e70..e74b4a15ccd6 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe.LinqService).sql @@ -3,13 +3,13 @@ SELECT [t3].[ParentID], - [t1].[COUNT_1], - [t2].[SUM_1] + [t1].[Count_1], + [t2].[Sum_1] FROM [Parent] [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [od] WHERE @@ -17,7 +17,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([od_1].[ParentID]) as [SUM_1] + SUM([od_1].[ParentID]) as [Sum_1] FROM [Child] [od_1] WHERE @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] @@ -38,7 +38,7 @@ BeforeExecute SELECT [x].[ParentID], [t1].[CountResult], - [t2].[SUM_1] + [t2].[Sum_1] FROM [Parent] [x] OUTER APPLY ( @@ -51,7 +51,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([od_1].[ParentID]) as [SUM_1] + SUM([od_1].[ParentID]) as [Sum_1] FROM [Child] [od_1] WHERE diff --git a/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe.LinqService).sql index 5ec0ebfde863..320e728e9c4a 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe.LinqService).sql @@ -3,13 +3,13 @@ SELECT [o].[ParentID], - [t1].[COUNT_1], - [t2].[SUM_1] + [t1].[Count_1], + [t2].[Sum_1] FROM [Parent] [o] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -17,7 +17,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([a_Children_1].[ParentID]) as [SUM_1] + SUM([a_Children_1].[ParentID]) as [Sum_1] FROM [Child] [a_Children_1] WHERE @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [o] @@ -38,7 +38,7 @@ BeforeExecute SELECT [x].[ParentID], [t1].[CountResult], - [t2].[SUM_1] + [t2].[Sum_1] FROM [Parent] [x] OUTER APPLY ( @@ -51,7 +51,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([a_Children_1].[ParentID]) as [SUM_1] + SUM([a_Children_1].[ParentID]) as [Sum_1] FROM [Child] [a_Children_1] WHERE diff --git a/SqlCe.LinqService/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe.LinqService).sql index 28896a802040..7133fe118cb4 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe.LinqService).sql @@ -46,7 +46,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TypeConvertTable] [t1] WHERE @@ -56,7 +56,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TypeConvertTable] [t1] WHERE @@ -68,7 +68,7 @@ DECLARE @cond NVarChar(36) -- String SET @cond = 'a948600d-de21-4f74-8ac2-9516b287076e' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TypeConvertTable] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe.LinqService).sql index 46f51363b613..4cd59e359d5e 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe.LinqService).sql index c1bb6e7396b7..d2b6b90bcbaa 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] CROSS JOIN [Parent] [s] diff --git a/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe.LinqService).sql index dfceb5a900a8..15a790b1eab5 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [parent_2] CROSS JOIN [Child] [child_1] diff --git a/SqlCe.LinqService/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe.LinqService).sql index 979eadd35b7d..551ae6e45074 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe.LinqService).sql index 9c917838cb60..265eb1fe598a 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t1] diff --git a/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe.LinqService).sql index 1f2e160245a0..1d20291b53ef 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t1] diff --git a/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe.LinqService).sql index 31ca9ff2a6e1..280474911d5e 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe.LinqService).sql index aae314150ccf..1d69cbf6fa21 100644 --- a/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1] as [Key_2], [p2].[Sum_1] as [Sum_2] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe.LinqService).sql index 7324496da32a..add66dd94895 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe.LinqService).sql @@ -32,7 +32,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -54,7 +54,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe.LinqService).sql index 7324496da32a..add66dd94895 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe.LinqService).sql @@ -32,7 +32,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -54,7 +54,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe.LinqService).sql index 83dbfef13b01..45960e43559d 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe.LinqService).sql @@ -38,7 +38,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -67,7 +67,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe.LinqService).sql index 59b0372f8e87..e1327c8f35d3 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe.LinqService).sql @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [gc] WHERE @@ -72,7 +72,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [gc] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe.LinqService).sql index e37d456127a5..0de8a865c0e2 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe.LinqService).sql @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE @@ -68,7 +68,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe.LinqService).sql index 19139250e6a0..4acc94cb81f6 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -58,7 +58,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe.LinqService).sql index 0eede5967c07..f5f25d1bca07 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe.LinqService).sql @@ -47,7 +47,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -77,7 +77,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe.LinqService).sql index b250e410b811..83ceb18b56ab 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe.LinqService).sql @@ -18,7 +18,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe.LinqService).sql index 994dc09a413c..da981202f96f 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe.LinqService).sql index 47b2252a2a85..a63a252a2799 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe.LinqService).sql @@ -18,7 +18,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [c_1] WHERE @@ -38,7 +38,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe.LinqService).sql index ba85c1adb0c8..a87e196e3ebf 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe.LinqService).sql index 24c921bfc246..b5f0c5c60d92 100644 --- a/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe.LinqService).sql index e8357d773278..b29344fa9618 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TestInsertOrReplaceTable] [x] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe.LinqService).sql index 977f4f57ddd9..ec1755e6e251 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe.LinqService).sql index f0a6510bb14f..0f96bea67bd4 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe.LinqService).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[PersonID]) as [MAX_1] + MAX([t1].[PersonID]) as [Max_1] FROM [Person] [t1] diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe.LinqService).sql index e843988d166f..630774f3f71a 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe.LinqService).sql index 6621cfc1caf9..111a458a5994 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe.LinqService).sql index 977f4f57ddd9..ec1755e6e251 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe.LinqService).sql index 977f4f57ddd9..ec1755e6e251 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe.LinqService).sql index f53a22c0dd10..29665483a52f 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe.LinqService).sql index f53a22c0dd10..29665483a52f 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe.LinqService).sql index f53a22c0dd10..29665483a52f 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe.LinqService).sql index f53a22c0dd10..29665483a52f 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe.LinqService).sql index f53a22c0dd10..29665483a52f 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe.LinqService).sql index 96ee13bcfc90..3564174645f8 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe.LinqService).sql index bfa9cd92b1cf..72ee4afa8bc9 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe.LinqService).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe.LinqService).sql index 91cc3fa327a1..bd732973f983 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe.LinqService).sql index 6dfd2abf9d46..145531a054ed 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe.LinqService).sql index ea73ed545a4d..31f2bf6fc835 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe.LinqService).sql @@ -56,7 +56,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe.LinqService).sql index bda1862fde6c..853027668fdc 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe.LinqService).sql @@ -109,7 +109,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -117,7 +117,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe.LinqService).sql index 65f8e38c494e..a155cce39786 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe.LinqService).sql @@ -104,7 +104,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -112,7 +112,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe.LinqService).sql index 13ea2e991f9f..640c8d14dff3 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @Value1 Int -- Int32 SET @Value1 = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe.LinqService).sql index c2b36e523be8..0deb22112e62 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe.LinqService).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe.LinqService).sql index ef631b1eed0d..e2d988cbe5b4 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe.LinqService).sql index be29e084f7e9..0db8cd53e1b1 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe.LinqService).sql index 6779479aebc9..23308e6c9791 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe.LinqService).sql @@ -82,7 +82,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] @@ -118,7 +118,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe.LinqService).sql index 6779479aebc9..23308e6c9791 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe.LinqService).sql @@ -82,7 +82,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] @@ -118,7 +118,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] diff --git a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe.LinqService).sql index d0756a00ebe1..549672d12544 100644 --- a/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe.LinqService).sql index 7a8b3d557e89..76e5cb06b0ae 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -63,7 +63,7 @@ DECLARE @p Int -- Int32 SET @p = 1003 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe.LinqService).sql index a842c5a3b99f..c822487caf70 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe.LinqService).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -63,7 +63,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe.LinqService).sql index 0bc65fde7fcb..9fc84df66aa0 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe.LinqService).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe.LinqService).sql index 68c611a031ca..9dc21950aa0b 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe.LinqService).sql @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe.LinqService).sql index 0bc65fde7fcb..9fc84df66aa0 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe.LinqService).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe.LinqService).sql index 0bc65fde7fcb..9fc84df66aa0 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe.LinqService).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe.LinqService).sql index 0bc65fde7fcb..9fc84df66aa0 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe.LinqService).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe.LinqService).sql index ba85c1adb0c8..a87e196e3ebf 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe.LinqService).sql index ba85c1adb0c8..a87e196e3ebf 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe.LinqService).sql index ba85c1adb0c8..a87e196e3ebf 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe.LinqService).sql index 7e8e50f7e7ce..aa735834de56 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe.LinqService).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -57,7 +57,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe.LinqService).sql index 2f0611d4ea26..cf3722274e1a 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe.LinqService).sql @@ -22,7 +22,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe.LinqService).sql index dcf3bac4c4b7..6cd5b7e4eb56 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe.LinqService).sql @@ -22,7 +22,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -48,7 +48,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -74,7 +74,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe.LinqService).sql index c27c7168534e..2d5d169d8905 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe.LinqService).sql @@ -47,7 +47,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe.LinqService).sql index c27c7168534e..2d5d169d8905 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe.LinqService).sql @@ -47,7 +47,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe.LinqService).sql b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe.LinqService).sql index a567a51c8866..1bff10bbb0c4 100644 --- a/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe.LinqService).sql +++ b/SqlCe.LinqService/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe.LinqService).sql @@ -47,13 +47,13 @@ WHERE [Parent] [p], ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p_1] WHERE [p_1].[ParentID] = @id ) [t1] WHERE - [p].[ParentID] = @id AND [t1].[COUNT_1] > 0 AND [Parent].[ParentID] = [p].[ParentID] + [p].[ParentID] = @id AND [t1].[Count_1] > 0 AND [Parent].[ParentID] = [p].[ParentID] ) diff --git a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_MultipleDataReadersOnSameCommand_Supported(SqlCe).sql b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_MultipleDataReadersOnSameCommand_Supported(SqlCe).sql index 1a20b60a4253..d7da7f1e412c 100644 --- a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_MultipleDataReadersOnSameCommand_Supported(SqlCe).sql +++ b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_MultipleDataReadersOnSameCommand_Supported(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_Dispose_Supported(SqlCe).sql b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_Dispose_Supported(SqlCe).sql index 1a20b60a4253..d7da7f1e412c 100644 --- a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_Dispose_Supported(SqlCe).sql +++ b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_Dispose_Supported(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_NoDispose_Supported(SqlCe).sql b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_NoDispose_Supported(SqlCe).sql index 1a20b60a4253..d7da7f1e412c 100644 --- a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_NoDispose_Supported(SqlCe).sql +++ b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_ProviderSupportsMultipleDataReadersOnNewCommand_NoDispose_Supported(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_Supported(SqlCe).sql b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_Supported(SqlCe).sql index 1c71e470a912..be03d7d6fe78 100644 --- a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_Supported(SqlCe).sql +++ b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_Supported(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_SupportedAsync(SqlCe).sql b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_SupportedAsync(SqlCe).sql index a1e8334a751f..5bb59021794d 100644 --- a/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_SupportedAsync(SqlCe).sql +++ b/SqlCe/Tests/Data/DataConnectionTests/Tests.Data.DataConnectionTests.MARS_SupportedAsync(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe).sql b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe).sql index 485340da7aee..a3763e02a5b9 100644 --- a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe).sql +++ b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableAverage(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - AVG([t1].[ParentID]) as [AVG_1] + AVG([t1].[ParentID]) as [Average] FROM [Parent] [t1] WHERE diff --git a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe).sql b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe).sql index a82f3b82d6ca..8805bf3fafa4 100644 --- a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe).sql +++ b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([t1].[ParentID]) as [MAX_1] + MAX([t1].[ParentID]) as [Max_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe).sql b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe).sql index 054d08504ba3..f66a5f6c43e0 100644 --- a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe).sql +++ b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMax2(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[MAX_1] + [t1].[Max_1] FROM [Parent] [p] OUTER APPLY ( SELECT - MAX([a_Children].[ParentID]) as [MAX_1] + MAX([a_Children].[ParentID]) as [Max_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlCe).sql b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlCe).sql new file mode 100644 index 000000000000..bd2944deb120 --- /dev/null +++ b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlCe).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlCe + +SELECT + MIN([t1].[ParentID]) as [Min_1] +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlCe).sql b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlCe).sql new file mode 100644 index 000000000000..dc04e14e2bfc --- /dev/null +++ b/SqlCe/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlCe).sql @@ -0,0 +1,16 @@ +BeforeExecute +-- SqlCe + +SELECT + [t1].[Min_1] +FROM + [Parent] [p] + OUTER APPLY ( + SELECT + MIN([a_Children].[ParentID]) as [Min_1] + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) [t1] + diff --git a/SqlCe/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe).sql b/SqlCe/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe).sql index 50ddc3e653af..f08bb4cdde1f 100644 --- a/SqlCe/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe).sql +++ b/SqlCe/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlCe).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe).sql b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe).sql index c9c5a2abea4c..9ca4af061c32 100644 --- a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe).sql +++ b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNotNullCount(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [NotNullParent] [p] INNER JOIN [NotNullChild] [a_ChildInner] ON [p].[ID] = [a_ChildInner].[ParentID] diff --git a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe).sql b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe).sql index cdb4b507e76c..936d0cfe8398 100644 --- a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe).sql +++ b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.AssociationExpressionNullCount(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [NotNullParent] [p] diff --git a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe).sql b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe).sql index 419c0d63b403..230c8b6d9503 100644 --- a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe).sql +++ b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest1(SqlCe).sql @@ -3,12 +3,12 @@ SELECT [p].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe).sql b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe).sql index 987127fc752b..9f9fa4fc1c7c 100644 --- a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.LetTest2(SqlCe).sql @@ -3,12 +3,12 @@ SELECT [t].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -20,12 +20,12 @@ BeforeExecute SELECT [t].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe).sql b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe).sql index 8f16d3137af4..ba641e9d4115 100644 --- a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe).sql +++ b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceAndExtension(SqlCe).sql @@ -3,12 +3,12 @@ SELECT [x].[Id], - [t1].[COUNT_1] + [t1].[Count_1] FROM [MainEntity] [x] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SubEntity] [a_SubEntities] WHERE diff --git a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe).sql b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe).sql index f3554e853629..a77cbb806ed4 100644 --- a/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe).sql +++ b/SqlCe/Tests/Linq/AssociationTests/Tests.Linq.AssociationTests.ViaInterfaceOfType(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [MainEntity] [x] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SubEntity] [a_SubEntities] WHERE diff --git a/SqlCe/Tests/Linq/BooleanTests/Tests.Linq.BooleanTests.Test(SqlCe).sql b/SqlCe/Tests/Linq/BooleanTests/Tests.Linq.BooleanTests.Test(SqlCe).sql index 7357a3e772e4..d02175c8f968 100644 --- a/SqlCe/Tests/Linq/BooleanTests/Tests.Linq.BooleanTests.Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/BooleanTests/Tests.Linq.BooleanTests.Test(SqlCe).sql @@ -716,183 +716,183 @@ SELECT COUNT(CASE WHEN [g_1].[Boolean] = 1 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[Boolean] = 1 THEN 1 ELSE NULL - END) as [COUNT_2], + END) as [Count_2], COUNT(CASE WHEN [g_1].[BooleanN] = 1 THEN 1 ELSE NULL - END) as [COUNT_3], + END) as [Count_3], COUNT(CASE WHEN [g_1].[Boolean] = 0 THEN 1 ELSE NULL - END) as [COUNT_4], + END) as [Count_4], COUNT(CASE WHEN [g_1].[BooleanN] = 0 THEN 1 ELSE NULL - END) as [COUNT_5], + END) as [Count_5], COUNT(CASE WHEN [g_1].[Boolean] = 0 THEN 1 ELSE NULL - END) as [COUNT_6], + END) as [Count_6], COUNT(CASE WHEN [g_1].[BooleanN] = 0 OR [g_1].[BooleanN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_7], + END) as [Count_7], COUNT(CASE WHEN [g_1].[Boolean] = 1 THEN 1 ELSE NULL - END) as [COUNT_8], + END) as [Count_8], COUNT(CASE WHEN [g_1].[BooleanN] = 1 OR [g_1].[BooleanN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_9], + END) as [Count_9], COUNT(CASE WHEN [g_1].[Int32] = 0 THEN 1 ELSE NULL - END) as [COUNT_10], + END) as [Count_10], COUNT(CASE WHEN [g_1].[Int32N] = 0 THEN 1 ELSE NULL - END) as [COUNT_11], + END) as [Count_11], COUNT(CASE WHEN [g_1].[Decimal] = 0 THEN 1 ELSE NULL - END) as [COUNT_12], + END) as [Count_12], COUNT(CASE WHEN [g_1].[DecimalN] = 0 THEN 1 ELSE NULL - END) as [COUNT_13], + END) as [Count_13], COUNT(CASE WHEN [g_1].[Double] = 0 THEN 1 ELSE NULL - END) as [COUNT_14], + END) as [Count_14], COUNT(CASE WHEN [g_1].[DoubleN] = 0 THEN 1 ELSE NULL - END) as [COUNT_15], + END) as [Count_15], COUNT(CASE WHEN [g_1].[Int32] <> 0 THEN 1 ELSE NULL - END) as [COUNT_16], + END) as [Count_16], COUNT(CASE WHEN [g_1].[Int32N] <> 0 OR [g_1].[Int32N] IS NULL THEN 1 ELSE NULL - END) as [COUNT_17], + END) as [Count_17], COUNT(CASE WHEN [g_1].[Decimal] <> 0 THEN 1 ELSE NULL - END) as [COUNT_18], + END) as [Count_18], COUNT(CASE WHEN [g_1].[DecimalN] <> 0 OR [g_1].[DecimalN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_19], + END) as [Count_19], COUNT(CASE WHEN [g_1].[Double] <> 0 THEN 1 ELSE NULL - END) as [COUNT_20], + END) as [Count_20], COUNT(CASE WHEN [g_1].[DoubleN] <> 0 OR [g_1].[DoubleN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_21], + END) as [Count_21], COUNT(CASE WHEN [g_1].[Int32] > 0 THEN 1 ELSE NULL - END) as [COUNT_22], + END) as [Count_22], COUNT(CASE WHEN [g_1].[Int32N] > 0 THEN 1 ELSE NULL - END) as [COUNT_23], + END) as [Count_23], COUNT(CASE WHEN [g_1].[Decimal] > 0 THEN 1 ELSE NULL - END) as [COUNT_24], + END) as [Count_24], COUNT(CASE WHEN [g_1].[DecimalN] > 0 THEN 1 ELSE NULL - END) as [COUNT_25], + END) as [Count_25], COUNT(CASE WHEN [g_1].[Double] > 0 THEN 1 ELSE NULL - END) as [COUNT_26], + END) as [Count_26], COUNT(CASE WHEN [g_1].[DoubleN] > 0 THEN 1 ELSE NULL - END) as [COUNT_27], + END) as [Count_27], COUNT(CASE WHEN [g_1].[Int32] < 0 THEN 1 ELSE NULL - END) as [COUNT_28], + END) as [Count_28], COUNT(CASE WHEN [g_1].[Int32N] < 0 THEN 1 ELSE NULL - END) as [COUNT_29], + END) as [Count_29], COUNT(CASE WHEN [g_1].[Decimal] < 0 THEN 1 ELSE NULL - END) as [COUNT_30], + END) as [Count_30], COUNT(CASE WHEN [g_1].[DecimalN] < 0 THEN 1 ELSE NULL - END) as [COUNT_31], + END) as [Count_31], COUNT(CASE WHEN [g_1].[Double] < 0 THEN 1 ELSE NULL - END) as [COUNT_32], + END) as [Count_32], COUNT(CASE WHEN [g_1].[DoubleN] < 0 THEN 1 ELSE NULL - END) as [COUNT_33], + END) as [Count_33], COUNT(CASE WHEN [g_1].[Int32] >= 0 THEN 1 ELSE NULL - END) as [COUNT_34], + END) as [Count_34], COUNT(CASE WHEN [g_1].[Int32N] >= 0 THEN 1 ELSE NULL - END) as [COUNT_35], + END) as [Count_35], COUNT(CASE WHEN [g_1].[Decimal] >= 0 THEN 1 ELSE NULL - END) as [COUNT_36], + END) as [Count_36], COUNT(CASE WHEN [g_1].[DecimalN] >= 0 THEN 1 ELSE NULL - END) as [COUNT_37], + END) as [Count_37], COUNT(CASE WHEN [g_1].[Double] >= 0 THEN 1 ELSE NULL - END) as [COUNT_38], + END) as [Count_38], COUNT(CASE WHEN [g_1].[DoubleN] >= 0 THEN 1 ELSE NULL - END) as [COUNT_39], + END) as [Count_39], COUNT(CASE WHEN [g_1].[Int32] <= 0 THEN 1 ELSE NULL - END) as [COUNT_40], + END) as [Count_40], COUNT(CASE WHEN [g_1].[Int32N] <= 0 THEN 1 ELSE NULL - END) as [COUNT_41], + END) as [Count_41], COUNT(CASE WHEN [g_1].[Decimal] <= 0 THEN 1 ELSE NULL - END) as [COUNT_42], + END) as [Count_42], COUNT(CASE WHEN [g_1].[DecimalN] <= 0 THEN 1 ELSE NULL - END) as [COUNT_43], + END) as [Count_43], COUNT(CASE WHEN [g_1].[Double] <= 0 THEN 1 ELSE NULL - END) as [COUNT_44], + END) as [Count_44], COUNT(CASE WHEN [g_1].[DoubleN] <= 0 THEN 1 ELSE NULL - END) as [COUNT_45] + END) as [Count_45] FROM [BooleanTable] [g_1] GROUP BY @@ -2469,183 +2469,183 @@ SELECT COUNT(CASE WHEN [g_1].[Boolean] = 1 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[Boolean] = 1 THEN 1 ELSE NULL - END) as [COUNT_2], + END) as [Count_2], COUNT(CASE WHEN [g_1].[BooleanN] = 1 THEN 1 ELSE NULL - END) as [COUNT_3], + END) as [Count_3], COUNT(CASE WHEN [g_1].[Boolean] = 0 THEN 1 ELSE NULL - END) as [COUNT_4], + END) as [Count_4], COUNT(CASE WHEN [g_1].[BooleanN] = 0 THEN 1 ELSE NULL - END) as [COUNT_5], + END) as [Count_5], COUNT(CASE WHEN [g_1].[Boolean] = 0 THEN 1 ELSE NULL - END) as [COUNT_6], + END) as [Count_6], COUNT(CASE WHEN [g_1].[BooleanN] = 0 OR [g_1].[BooleanN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_7], + END) as [Count_7], COUNT(CASE WHEN [g_1].[Boolean] = 1 THEN 1 ELSE NULL - END) as [COUNT_8], + END) as [Count_8], COUNT(CASE WHEN [g_1].[BooleanN] = 1 OR [g_1].[BooleanN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_9], + END) as [Count_9], COUNT(CASE WHEN [g_1].[Int32] = 0 THEN 1 ELSE NULL - END) as [COUNT_10], + END) as [Count_10], COUNT(CASE WHEN [g_1].[Int32N] = 0 THEN 1 ELSE NULL - END) as [COUNT_11], + END) as [Count_11], COUNT(CASE WHEN [g_1].[Decimal] = 0 THEN 1 ELSE NULL - END) as [COUNT_12], + END) as [Count_12], COUNT(CASE WHEN [g_1].[DecimalN] = 0 THEN 1 ELSE NULL - END) as [COUNT_13], + END) as [Count_13], COUNT(CASE WHEN [g_1].[Double] = 0 THEN 1 ELSE NULL - END) as [COUNT_14], + END) as [Count_14], COUNT(CASE WHEN [g_1].[DoubleN] = 0 THEN 1 ELSE NULL - END) as [COUNT_15], + END) as [Count_15], COUNT(CASE WHEN [g_1].[Int32] <> 0 THEN 1 ELSE NULL - END) as [COUNT_16], + END) as [Count_16], COUNT(CASE WHEN [g_1].[Int32N] <> 0 OR [g_1].[Int32N] IS NULL THEN 1 ELSE NULL - END) as [COUNT_17], + END) as [Count_17], COUNT(CASE WHEN [g_1].[Decimal] <> 0 THEN 1 ELSE NULL - END) as [COUNT_18], + END) as [Count_18], COUNT(CASE WHEN [g_1].[DecimalN] <> 0 OR [g_1].[DecimalN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_19], + END) as [Count_19], COUNT(CASE WHEN [g_1].[Double] <> 0 THEN 1 ELSE NULL - END) as [COUNT_20], + END) as [Count_20], COUNT(CASE WHEN [g_1].[DoubleN] <> 0 OR [g_1].[DoubleN] IS NULL THEN 1 ELSE NULL - END) as [COUNT_21], + END) as [Count_21], COUNT(CASE WHEN [g_1].[Int32] > 0 THEN 1 ELSE NULL - END) as [COUNT_22], + END) as [Count_22], COUNT(CASE WHEN [g_1].[Int32N] > 0 THEN 1 ELSE NULL - END) as [COUNT_23], + END) as [Count_23], COUNT(CASE WHEN [g_1].[Decimal] > 0 THEN 1 ELSE NULL - END) as [COUNT_24], + END) as [Count_24], COUNT(CASE WHEN [g_1].[DecimalN] > 0 THEN 1 ELSE NULL - END) as [COUNT_25], + END) as [Count_25], COUNT(CASE WHEN [g_1].[Double] > 0 THEN 1 ELSE NULL - END) as [COUNT_26], + END) as [Count_26], COUNT(CASE WHEN [g_1].[DoubleN] > 0 THEN 1 ELSE NULL - END) as [COUNT_27], + END) as [Count_27], COUNT(CASE WHEN [g_1].[Int32] < 0 THEN 1 ELSE NULL - END) as [COUNT_28], + END) as [Count_28], COUNT(CASE WHEN [g_1].[Int32N] < 0 THEN 1 ELSE NULL - END) as [COUNT_29], + END) as [Count_29], COUNT(CASE WHEN [g_1].[Decimal] < 0 THEN 1 ELSE NULL - END) as [COUNT_30], + END) as [Count_30], COUNT(CASE WHEN [g_1].[DecimalN] < 0 THEN 1 ELSE NULL - END) as [COUNT_31], + END) as [Count_31], COUNT(CASE WHEN [g_1].[Double] < 0 THEN 1 ELSE NULL - END) as [COUNT_32], + END) as [Count_32], COUNT(CASE WHEN [g_1].[DoubleN] < 0 THEN 1 ELSE NULL - END) as [COUNT_33], + END) as [Count_33], COUNT(CASE WHEN [g_1].[Int32] >= 0 THEN 1 ELSE NULL - END) as [COUNT_34], + END) as [Count_34], COUNT(CASE WHEN [g_1].[Int32N] >= 0 THEN 1 ELSE NULL - END) as [COUNT_35], + END) as [Count_35], COUNT(CASE WHEN [g_1].[Decimal] >= 0 THEN 1 ELSE NULL - END) as [COUNT_36], + END) as [Count_36], COUNT(CASE WHEN [g_1].[DecimalN] >= 0 THEN 1 ELSE NULL - END) as [COUNT_37], + END) as [Count_37], COUNT(CASE WHEN [g_1].[Double] >= 0 THEN 1 ELSE NULL - END) as [COUNT_38], + END) as [Count_38], COUNT(CASE WHEN [g_1].[DoubleN] >= 0 THEN 1 ELSE NULL - END) as [COUNT_39], + END) as [Count_39], COUNT(CASE WHEN [g_1].[Int32] <= 0 THEN 1 ELSE NULL - END) as [COUNT_40], + END) as [Count_40], COUNT(CASE WHEN [g_1].[Int32N] <= 0 THEN 1 ELSE NULL - END) as [COUNT_41], + END) as [Count_41], COUNT(CASE WHEN [g_1].[Decimal] <= 0 THEN 1 ELSE NULL - END) as [COUNT_42], + END) as [Count_42], COUNT(CASE WHEN [g_1].[DecimalN] <= 0 THEN 1 ELSE NULL - END) as [COUNT_43], + END) as [Count_43], COUNT(CASE WHEN [g_1].[Double] <= 0 THEN 1 ELSE NULL - END) as [COUNT_44], + END) as [Count_44], COUNT(CASE WHEN [g_1].[DoubleN] <= 0 THEN 1 ELSE NULL - END) as [COUNT_45] + END) as [Count_45] FROM [BooleanTable] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe).sql b/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe).sql index 4df37ba49cce..7b7093d6a3d6 100644 --- a/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest2(SqlCe).sql @@ -9,12 +9,12 @@ SELECT [t2].[Gender], [t2].[LastName] + ', ' + [t2].[FirstName] as [FullName], [t2].[LastName] + ', ' + [t2].[FirstName] as [AsSqlFullName], - [t1].[COUNT_1] as [DoctorCount] + [t1].[DoctorCount] FROM [Person] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [DoctorCount] FROM [Doctor] [d] WHERE diff --git a/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe).sql b/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe).sql index b57aba56ee42..b31be7702387 100644 --- a/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe).sql +++ b/SqlCe/Tests/Linq/CalculatedColumnTests/Tests.Linq.CalculatedColumnTests.CalculatedColumnTest3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [t2].[COUNT_1], + [t2].[Count_1], [t].[PersonID], [t].[FirstName], [t].[LastName], @@ -23,7 +23,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Doctor] [d_1] WHERE diff --git a/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe).sql b/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe).sql index 845102f513bf..70387276120a 100644 --- a/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe).sql +++ b/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.CharTrimming(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([t1].[ID]) as [MAX_1] + MAX([t1].[ID]) as [Max_1] FROM [AllTypes] [t1] diff --git a/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe).sql b/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe).sql index 70e7fc19907f..d01c6a618689 100644 --- a/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe).sql +++ b/SqlCe/Tests/Linq/CharTypesTests/Tests.Linq.CharTypesTests.StringTrimming(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([t1].[ID]) as [MAX_1] + MAX([t1].[ID]) as [Max_1] FROM [AllTypes] [t1] diff --git a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe).sql b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe).sql index f1258f524750..01fa6b818a26 100644 --- a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe).sql +++ b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe).sql b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe).sql index f1258f524750..01fa6b818a26 100644 --- a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.ProjectionTest2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe).sql b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe).sql index 7a81cead04e1..3b9f483efe84 100644 --- a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe).sql +++ b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe).sql b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe).sql index 415165728a21..192d14042465 100644 --- a/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/ColumnAliasTests/Tests.Linq.ColumnAliasTests.UnionTest2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe).sql b/SqlCe/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe).sql index bc863cf91c4b..a2e1d801fe16 100644 --- a/SqlCe/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe).sql +++ b/SqlCe/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlCe).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe).sql index ee22d58da473..c8b6cd14ed32 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe).sql index ee22d58da473..c8b6cd14ed32 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTest2(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe).sql index 5360620b8c34..a063b24476e7 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe).sql index 5360620b8c34..34a53af9eb6d 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.CountTestAsync2(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe).sql index 30e548fb001a..5caa019ee317 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe).sql index 30e548fb001a..5caa019ee317 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTest2(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe).sql index 2d5939ed7a41..d9ea00f90596 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe).sql b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe).sql index 2d5939ed7a41..d9ea00f90596 100644 --- a/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTests/Tests.Linq.CompileTests.MaxTestAsync2(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ DECLARE @p Int -- Int32 SET @p = -1 SELECT - MAX([c_1].[ParentID]) as [MAX_1] + MAX([c_1].[ParentID]) as [Max_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe).sql b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe).sql index 80a6e4288ccb..8673fdcf1ccf 100644 --- a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.CountPredicateAsync(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe).sql b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe).sql index 80a6e4288ccb..05dfa59c734f 100644 --- a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.LongCountPredicateAsync(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe).sql b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe).sql index 3a4b01c245f4..f8e499bc01c5 100644 --- a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MaxSelectorAsync(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - MAX([c_1].[Id]) as [MAX_1] + MAX([c_1].[Id]) as [Max_1] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe).sql b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe).sql index 85c91a8a20af..3953e427bcc2 100644 --- a/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe).sql +++ b/SqlCe/Tests/Linq/CompileTestsAsync/Tests.Linq.CompileTestsAsync.MinSelectorAsync(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @p Int -- Int32 SET @p = 2 SELECT - MIN([c_1].[Id]) as [MIN_1] + MIN([c_1].[Id]) as [Min_1] FROM [AsyncDataTable] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe).sql b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe).sql index 3847b6aff29d..c64987fb233a 100644 --- a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatCount_ShouldNotRemoveSingleColumn(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe).sql b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe).sql index 2b14953b6443..489c7ba93341 100644 --- a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.ConcatSumTest(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([t3].[PersonID]) as [SUM_1] + SUM([t3].[PersonID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe).sql b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe).sql index b118b9fd6cdf..5da4a7333501 100644 --- a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.Issue3346_Count(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe).sql b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe).sql index 8772e825cf1a..09a77db7df63 100644 --- a/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConcatUnionTests/Tests.Linq.ConcatUnionTests.UnionCount_ShouldNotRemoveSingleColumn(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,False).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,False).sql index 56093f05fec9..18b924373021 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,True).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,True).sql index ec73dceb3d57..5e670d390b4c 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNulls(SqlCe,True).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,False).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,False).sql index 3878693f6cb3..d5b74269d6ed 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,False).sql @@ -2,27 +2,23 @@ -- SqlCe DECLARE @In NVarChar -- String SET @In = NULL -DECLARE @In_1 NVarChar -- String -SET @In_1 = NULL SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlCe DECLARE @NotIn NVarChar -- String SET @NotIn = NULL -DECLARE @NotIn_1 NVarChar -- String -SET @NotIn_1 = NULL SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,True).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,True).sql index 40f41186da01..d63e203886e5 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlCe,True).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,False).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,False).sql index 5cc794241057..636db4a7df52 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,True).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,True).sql index 4d3197ccf7fd..007a7dde2762 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsEnum(SqlCe,True).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,False).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,False).sql index 9a7476614961..552706d67420 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,True).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,True).sql index 9a7476614961..552706d67420 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.Empty(SqlCe,True).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,False).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,False).sql index 9a7476614961..552706d67420 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,True).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,True).sql index 9a7476614961..552706d67420 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyCEnum(SqlCe,True).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,False).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,False).sql index 9a7476614961..552706d67420 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,True).sql b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,True).sql index 9a7476614961..552706d67420 100644 --- a/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.EmptyEnum(SqlCe,True).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe).sql index f78cb39f0954..4c6a02bfe5df 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest4(SqlCe).sql @@ -14,7 +14,7 @@ SELECT THEN 1 ELSE 0 END as [c1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t2].[ChildID], [t3].[ParentID] as [ParentID_1], @@ -23,7 +23,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe).sql index f78cb39f0954..4c6a02bfe5df 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest41(SqlCe).sql @@ -14,7 +14,7 @@ SELECT THEN 1 ELSE 0 END as [c1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t2].[ChildID], [t3].[ParentID] as [ParentID_1], @@ -23,7 +23,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe).sql index 6a3cd6a7843a..531cb93a36d8 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest5(SqlCe).sql @@ -14,7 +14,7 @@ SELECT THEN 1 ELSE 0 END as [c1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t3].[ParentID] as [ParentID_1], [t3].[ChildID] @@ -22,7 +22,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe).sql index db0d3f9a6a50..fa822b950dbf 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest6(SqlCe).sql @@ -15,7 +15,7 @@ SELECT THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -23,7 +23,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe).sql index db0d3f9a6a50..fa822b950dbf 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest61(SqlCe).sql @@ -15,7 +15,7 @@ SELECT THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -23,7 +23,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe).sql index 2b9f8fa164d2..bf2b8be086eb 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest7(SqlCe).sql @@ -17,7 +17,7 @@ SELECT TOP (@take) THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -25,7 +25,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe).sql index 2b9f8fa164d2..bf2b8be086eb 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest71(SqlCe).sql @@ -17,7 +17,7 @@ SELECT TOP (@take) THEN 1 ELSE 0 END as [Any_1], - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID] as [ParentID_1], [t3].[ParentID] as [ParentID_2], [t3].[ChildID] @@ -25,7 +25,7 @@ FROM [Parent] [t] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe).sql index 4281e3c53eb0..d4ec3c39f417 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.LetTest8(SqlCe).sql @@ -18,7 +18,7 @@ SELECT THEN 1 ELSE 0 END as [c2], - [t3].[COUNT_1], + [t3].[Count_1], [t4].[ParentID], [t4].[ChildID] FROM @@ -47,7 +47,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_3] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe).sql index 820775c5bdca..d9b8b4c59f40 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select1(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe).sql index 0ca1424303d0..0c61984fbb82 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select2(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe).sql index 4797212e9446..9c6dc797ea9c 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select3(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [t] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe).sql index 4797212e9446..9c6dc797ea9c 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Select4(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [t] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe).sql index 17b34c84c7c4..5303baaac131 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where1(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe).sql index 17b34c84c7c4..5303baaac131 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where2(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe).sql b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe).sql index 9900681143af..408af4601dd8 100644 --- a/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertExpressionTests/Tests.Linq.ConvertExpressionTests.Where3(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe).sql b/SqlCe/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe).sql index c836ce0c7b89..575125cb1c54 100644 --- a/SqlCe/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe).sql +++ b/SqlCe/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) as [Length_1] FROM [LinqDataTypes] [p] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe).sql index 96fd704d3a8e..e149107b5999 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe).sql index 3aab68e247a7..6a20791d4d67 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count1Async(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe).sql index 7d42d46d3d1b..1e2531b4059f 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe).sql index 895d3308ebb5..dc40e4cd111b 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count2Async(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe).sql index 643f1b712bdd..a10e047767a9 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count3(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe).sql index 1d2d8f69e700..58b0f169aaf9 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count4(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t2].[COUNT_1] + [t2].[Count_1] FROM [Parent] [p] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [t1] ) [t2] ON 1=1 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe).sql index f3511f60e538..d60b8d15f684 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count5(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe).sql index a72d3a26ee4e..46a30e5518be 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe).sql index 59985006375e..7a9a41c88771 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlCe).sql @@ -2,10 +2,10 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -13,10 +13,10 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe).sql index 71a3ece2af87..8e3a340fcf1c 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlCe).sql @@ -2,10 +2,10 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe).sql index b8ba8d6af171..0c8189fb5829 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy1(SqlCe).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe).sql index 3e9597a05be9..5cb12568f3a6 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy101(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe).sql index 8111a29bb623..b8f7d2f361ac 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy103(SqlCe).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe).sql index 570aa4e8ee2f..4630785aeb68 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy21(SqlCe).sql @@ -7,7 +7,7 @@ SELECT COUNT(CASE WHEN [g_2].[ParentID] < 3 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe).sql index b8cbc4ec4bf5..7e51a5bf224d 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy22(SqlCe).sql @@ -7,7 +7,7 @@ SELECT COUNT(CASE WHEN [g_2].[ParentID] < 3 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe).sql index 00f69a5fbe0f..ea82be38502c 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy3(SqlCe).sql @@ -3,11 +3,11 @@ SELECT [g_2].[ParentID], - MIN([g_2].[ChildID]) as [MIN_1], + MIN([g_2].[ChildID]) as [Min_1], COUNT(CASE WHEN [g_2].[ChildID] > 25 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe).sql index b9f7d065e206..f74073a96e4a 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy4(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe).sql index f3511f60e538..d60b8d15f684 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy6(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe).sql index 32fd81a0a708..49f6be89bbdf 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy7(SqlCe).sql @@ -2,8 +2,8 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1], - MAX([g_1].[ChildID]) as [MAX_1] + COUNT(*) as [Count_1], + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe).sql index df8119623d03..c776052b1c53 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [ch] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe).sql index 935979bb0497..00a27a611d5d 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlCe).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe).sql index 83603b7696f0..1e65fa397674 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlCe).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe).sql index 53ed5381dc65..0ea1280eaa65 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin1(SqlCe).sql @@ -2,13 +2,13 @@ -- SqlCe SELECT - [t1].[COUNT_1], - [t2].[COUNT_1] as [COUNT_2] + [t1].[Count_1], + [t2].[Count_1] as [Count_2] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_1] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe).sql index 53ed5381dc65..0ea1280eaa65 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin2(SqlCe).sql @@ -2,13 +2,13 @@ -- SqlCe SELECT - [t1].[COUNT_1], - [t2].[COUNT_1] as [COUNT_2] + [t1].[Count_1], + [t2].[Count_1] as [Count_2] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -16,7 +16,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_1] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe).sql index b525c28b8768..86b64b1deff5 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin3(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe).sql index c2031dc7f8f3..e97924e83acd 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[COUNT_1] as [c1] + [t1].[Count_1] + [t1].[Count_1] as [c1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe).sql index e1f76fb1be97..f97cae096f6f 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery1(SqlCe).sql @@ -3,12 +3,12 @@ SELECT [p].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe).sql index ac9a9583dc04..c62475fcb7d0 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlCe).sql @@ -3,14 +3,14 @@ SELECT CASE - WHEN [p].[Value1] IS NULL THEN [t1].[COUNT_1] - ELSE [t2].[COUNT_1] + WHEN [p].[Value1] IS NULL THEN [t1].[Count_1] + ELSE [t2].[Count_1] END as [c1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -18,11 +18,11 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) [t2] WHERE [p].[ParentID] <> 5 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe).sql index ac9a9583dc04..c62475fcb7d0 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlCe).sql @@ -3,14 +3,14 @@ SELECT CASE - WHEN [p].[Value1] IS NULL THEN [t1].[COUNT_1] - ELSE [t2].[COUNT_1] + WHEN [p].[Value1] IS NULL THEN [t1].[Count_1] + ELSE [t2].[Count_1] END as [c1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -18,11 +18,11 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) [t2] WHERE [p].[ParentID] <> 5 diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe).sql index 5994227ba1f4..7aeecf0977ca 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery4(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p1] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe).sql index 5994227ba1f4..7aeecf0977ca 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery5(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p1] WHERE diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe).sql index 9b814e662b1a..251617436967 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - MAX([t1].[COUNT_1]) as [MAX_1] + MAX([t1].[Count_1]) as [Max_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe).sql index 315dfe76dc20..870716907e77 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe (asynchronously) SELECT - MAX([t1].[COUNT_1]) as [MAX_1] + MAX([t1].[Count_1]) as [Max_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe).sql b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe).sql index a011ef04e381..84734013ff16 100644 --- a/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe).sql +++ b/SqlCe/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - MAX([t1].[COUNT_1]) as [MAX_1] + MAX([t1].[Count_1]) as [Max_1] FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe).sql index 4d5a48bd4e33..b827d47cb5db 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegative(SqlCe).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe).sql index fe350ecc7a84..bc885597a4e8 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnNegativeExpression(SqlCe).sql @@ -48,7 +48,7 @@ DECLARE @part2 Int -- Int32 SET @part2 = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe).sql index 0d33d8e11214..f7e693f9a5d7 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositive(SqlCe).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe).sql index 6aa4063772b9..064ae755533c 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.AddDaysFromColumnPositiveExpression(SqlCe).sql @@ -48,7 +48,7 @@ DECLARE @part2 Int -- Int32 SET @part2 = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe).sql index 85fb54bdaa98..e76f01a0bf1f 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlCe).sql @@ -3,9 +3,9 @@ SELECT [g_1].[ID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) as [Value_1], - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) as [MAX_1] + MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) as [Max_1] FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe).sql index 3f89611d3ede..16bdfb97946b 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.GetDateTest2(SqlCe).sql @@ -5,7 +5,7 @@ SET @take = 5 SELECT TOP (@take) [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe).sql index 72fae87d9f84..147869eae3da 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01' AS DateTime) as [c1] + CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01' AS DateTime) as [Value_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe).sql b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe).sql index dcf8f6d67d4b..c498115a7384 100644 --- a/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe).sql +++ b/SqlCe/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.MakeDateTime2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01 20:35:44.000' AS DateTime) as [c1] + CAST('2010-' + REPLICATE('0', 2 - LEN(CAST([t].[ID] AS NVarChar(2)))) + CAST([t].[ID] AS NVarChar(2)) + '-01 20:35:44.000' AS DateTime) as [Value_1] FROM [LinqDataTypes] [t] WHERE diff --git a/SqlCe/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe).sql b/SqlCe/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe).sql index 19aef0cc800d..9d6a5bda6774 100644 --- a/SqlCe/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe).sql +++ b/SqlCe/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [t2].[SUM_1] + [t2].[Sum_1] FROM [Parent] [p] OUTER APPLY ( @@ -10,7 +10,7 @@ FROM SUM(CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END) as [SUM_1] + END) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe).sql b/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe).sql index cd212f7cd86a..d48e43b37903 100644 --- a/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe).sql +++ b/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctCount(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT diff --git a/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe).sql b/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe).sql index 8c4a2c2b257a..01d0c056082f 100644 --- a/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe).sql +++ b/SqlCe/Tests/Linq/DistinctTests/Tests.Linq.DistinctTests.DistinctMax(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([t1].[ParentID]) as [MAX_1] + MAX([t1].[ParentID]) as [Max_1] FROM ( SELECT DISTINCT diff --git a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe).sql b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe).sql index eca573c998b4..700a079a47fc 100644 --- a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe).sql +++ b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupBy(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [p].[FirstName] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] GROUP BY diff --git a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe).sql b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe).sql index e5db07402c8c..ec19dfb95e74 100644 --- a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe).sql +++ b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyGroupByAssociated(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [a_Patient].[Diagnosis] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] LEFT JOIN [Patient] [a_Patient] ON [p].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe).sql b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe).sql index c6ae9f6e1012..a20db1732c67 100644 --- a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe).sql +++ b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping1(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_1].[FirstName] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe).sql b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe).sql index ed3dbb7c488d..a03ef38e4e5e 100644 --- a/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe).sql +++ b/SqlCe/Tests/Linq/DynamicColumnsTests/Tests.Linq.DynamicColumnsTests.SqlPropertyNoStoreGrouping2(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [g_1].[FirstName], [g_1].[LastName], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe).sql b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe).sql index 2d46347b655e..a4b285049b03 100644 --- a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe).sql +++ b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlCe).sql @@ -8,12 +8,12 @@ FROM [Item] [x] OUTER APPLY ( SELECT - SUM([a_Values].[Value]) as [SUM_1] + SUM([a_Values].[Value]) as [Sum_1] FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] ) [t1] ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] diff --git a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe).sql b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe).sql index 1450bfcd18f9..ea0bcc22fb2a 100644 --- a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe).sql +++ b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlCe).sql @@ -22,12 +22,12 @@ FROM [Item] [x] OUTER APPLY ( SELECT - SUM([a_Values].[Value]) as [SUM_1] + SUM([a_Values].[Value]) as [Sum_1] FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] ) [t1] ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] diff --git a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe).sql b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe).sql index ba753aeb0c2e..0101e3480e91 100644 --- a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe).sql +++ b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlCe).sql @@ -22,12 +22,12 @@ FROM [Item] [x] OUTER APPLY ( SELECT - SUM([a_Values].[Value]) as [SUM_1] + SUM([a_Values].[Value]) as [Sum_1] FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] ) [t1] ORDER BY - Coalesce([t1].[SUM_1], 0) + Coalesce([t1].[Sum_1], 0) diff --git a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe).sql b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe).sql index d5edd27bd659..826b1d2aeb5f 100644 --- a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe).sql +++ b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlCe).sql @@ -2,13 +2,13 @@ -- SqlCe SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe).sql b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe).sql index 1de78f1747e0..339b85ed13a3 100644 --- a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe).sql +++ b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [DetailClass] [a_Details] WHERE @@ -15,7 +15,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT @@ -35,7 +35,7 @@ FROM ) [t3] ) [t4] WHERE - [t1].[COUNT_1] > 1 + [t1].[Count_1] > 1 BeforeExecute BeginTransaction(RepeatableRead) diff --git a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe).sql b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe).sql index 82f30168ac16..ef98d7926300 100644 --- a/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe).sql +++ b/SqlCe/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.WithTableAttributeMethods(SqlCe).sql @@ -43,10 +43,10 @@ FROM [Person] [p], ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [UserIssue3128] [t1] ) [t2] WHERE - [t2].[COUNT_1] > 0 + [t2].[Count_1] > 0 diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe).sql index f8cb092e6e23..b8affeecd03f 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains1(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe).sql index f8cb092e6e23..b8affeecd03f 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains2(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe).sql index f8cb092e6e23..b8affeecd03f 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains3(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe).sql index f8cb092e6e23..b8affeecd03f 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapContains4(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert1(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert2(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert3(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsert4(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe).sql index 0b2b6d24ff7d..4bc2c456bad8 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam1(SqlCe).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe).sql index 0b2b6d24ff7d..4bc2c456bad8 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam2(SqlCe).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe).sql index 0b2b6d24ff7d..4bc2c456bad8 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam3(SqlCe).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe).sql index 0b2b6d24ff7d..4bc2c456bad8 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertFromSelectWithParam4(SqlCe).sql @@ -44,7 +44,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe).sql index c0e514d0c47d..86053f26591f 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject1(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe).sql index 860998929a97..a8e3f1c89b2a 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject2(SqlCe).sql @@ -34,7 +34,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe).sql index c0e514d0c47d..86053f26591f 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject3(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe).sql index 1b1f97461610..3c23c06d74ce 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapInsertObject4(SqlCe).sql @@ -34,7 +34,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject1(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject2(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject3(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe).sql index 1707d69e7487..3c7dacc52805 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapIntermediateObject4(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe).sql index b0ce57965ca6..06399201299b 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet3(SqlCe).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe).sql b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe).sql index b0ce57965ca6..06399201299b 100644 --- a/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumMappingTests/Tests.Linq.EnumMappingTests.EnumMapSet6(SqlCe).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [r] WHERE diff --git a/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlCe).sql b/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlCe).sql index 05c55da4daf6..a05f74613f3c 100644 --- a/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlCe).sql @@ -2,8 +2,7 @@ -- SqlCe SELECT - [it_1].[cond_1] as [cond], - [it_1].[cond] as [cond_1], + [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], [it_1].[Count_1], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM ( - SELECT [a_Color].[Name] AS [ColorName], [t2].[COUNT_1] AS [Count], 0 AS [index], [a_Style].[Name] AS [StyleName], CASE - WHEN [a_Color].[Name] = 'Red' THEN [t2].[COUNT_1] + SELECT [a_Color].[Name] AS [ColorName], [t2].[Count_1] AS [Count], [a_Style].[Name] AS [StyleName], CASE + WHEN [a_Color].[Name] = 'Red' THEN [t2].[Count_1] ELSE 0 END AS [Conditional], 1 AS [field1], 2 AS [field2], 3 AS [field3] UNION ALL - SELECT NULL AS [ColorName], 0 AS [Count], 1 AS [index], [a_Style].[Name] AS [StyleName], NULL AS [Conditional], 4 AS [field1], 5 AS [field2], 6 AS [field3]) [it] + SELECT NULL AS [ColorName], 0 AS [Count], [a_Style].[Name] AS [StyleName], NULL AS [Conditional], 4 AS [field1], 5 AS [field2], 6 AS [field3]) [it] ) [it_1] WHERE [it_1].[ColorName] = 'Red' OR [it_1].[Count_1] = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY ( - SELECT [a_Color].[Name] AS [ColorName], [t2].[COUNT_1] AS [Count], CASE - WHEN [a_Color].[Name] = 'Red' THEN [t2].[COUNT_1] + SELECT [a_Color].[Name] AS [ColorName], [t2].[Count_1] AS [Count], CASE + WHEN [a_Color].[Name] = 'Red' THEN [t2].[Count_1] ELSE 0 END AS [Conditional] UNION ALL diff --git a/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlCe).sql b/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlCe).sql index 8a1d69817800..3076ca9e922a 100644 --- a/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlCe).sql +++ b/SqlCe/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlCe).sql @@ -12,7 +12,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -24,7 +24,7 @@ FROM 1 as [cond] FROM ( - SELECT [a_Color].[Name] AS [ColorName], [a_Style].[Name] AS [StyleName], [t2].[COUNT_1] AS [Count] + SELECT [a_Color].[Name] AS [ColorName], [a_Style].[Name] AS [StyleName], [t2].[Count_1] AS [Count] UNION ALL SELECT NULL AS [ColorName], [a_Style].[Name] AS [StyleName], 0 AS [Count]) [it] ) [it_1] diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe).sql index b63d2c64f9cf..48fac95f8802 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpression(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] INNER JOIN [GrandChild] [a_GrandChildren] ON [a_Children].[ParentID] = [a_GrandChildren].[ParentID] AND [a_Children].[ChildID] = [a_GrandChildren].[ChildID] diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe).sql index 13f267315f5c..5c2036435d1e 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.AssociationMethodExpressionAsync(SqlCe).sql @@ -11,12 +11,12 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] INNER JOIN [GrandChild] [a_GrandChildren] ON [a_Children].[ParentID] = [a_GrandChildren].[ParentID] AND [a_Children].[ChildID] = [a_GrandChildren].[ChildID] diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe).sql index 437ef8ff69d2..8f2ed6c832c1 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.ComparisonTest2(SqlCe).sql @@ -14,7 +14,7 @@ SELECT [Person] [t7] CROSS JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [t1] WHERE @@ -29,7 +29,7 @@ SELECT ) [t3] CROSS JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [t4] WHERE @@ -43,7 +43,7 @@ SELECT ) ) [t6] WHERE - [t3].[COUNT_1] = 0 AND [t6].[COUNT_1] = 0 + [t3].[Count_1] = 0 AND [t6].[Count_1] = 0 ) THEN 1 ELSE 0 diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe).sql index cb8ae3b282f2..dba8fc2dec6e 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.Issue3472Test(SqlCe).sql @@ -3,12 +3,12 @@ SELECT [t2].[Id], - [t1].[COUNT_1] as [PersonsCount] + [t1].[PersonsCount] FROM [Issue3472TableDC] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [PersonsCount] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe).sql index bb3d035d4d2f..d68f1b5a5e55 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlCe).sql @@ -2,15 +2,15 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) [t1] diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe).sql index 2dbcf48fe35f..9568cc13d647 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlCe).sql @@ -2,15 +2,15 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) [t1] diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe).sql index aabda5645fd8..445fa55508b4 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlCe).sql @@ -4,15 +4,15 @@ DECLARE @n Int -- Int32 SET @n = 3 SELECT - [t1].[COUNT_1] + 4 as [Count4] + [t1].[Count4] + 4 as [Count4] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count4] FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) [t1] diff --git a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe).sql b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe).sql index 42ccd1868d35..c469937e4c3a 100644 --- a/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe).sql +++ b/SqlCe/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression6(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] as [Count6] + [t1].[Count6] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count6] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe).sql b/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe).sql index 2e6a8da85413..2d809d4e0bbf 100644 --- a/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe).sql +++ b/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert1(SqlCe).sql @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe).sql b/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe).sql index 1d9f3846ba50..6cd1b91b5b4c 100644 --- a/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe).sql +++ b/SqlCe/Tests/Linq/FSharpTests/Tests.Linq.FSharpTests.Insert2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([t1].[PersonID]) as [MAX_1] + MAX([t1].[PersonID]) as [Max_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe).sql b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe).sql index 94d65747569b..5780fe87895e 100644 --- a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe).sql +++ b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Count1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe).sql b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe).sql index 6c1f850abfaa..654258f82931 100644 --- a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe).sql +++ b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.CustomAggregate(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([g_1].[Value1]) as [SUM_1], + SUM([g_1].[Value1]) as [Sum_1], SUM([g_1].[Value1]) as [c1] FROM [Parent] [g_1] diff --git a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe).sql b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe).sql index 33022e351ebe..e9e3b3297c43 100644 --- a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe).sql +++ b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([t1].[ParentID]) as [SUM_1] + SUM([t1].[ParentID]) as [Sum_1] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe).sql b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe).sql index 72d3f647b043..52cb2c55fabb 100644 --- a/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe).sql +++ b/SqlCe/Tests/Linq/FunctionTests/Tests.Linq.FunctionTests.Sum2(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[SUM_1] as [ChildCount] + [t1].[ChildCount] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([a_Children].[ParentID] * [a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ParentID] * [a_Children].[ChildID]) as [ChildCount] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe).sql index 4ae0ff32a8cc..c09ccbff1309 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AggregateAssociation(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM(Coalesce([a_Parent].[Value1], 0)) as [SUM_1] + SUM(Coalesce([a_Parent].[Value1], 0)) as [Sum_1] FROM [Child] [grp] LEFT JOIN [Parent] [a_Parent] ON [grp].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe).sql index df4838ed80c5..0890767efb34 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates1(SqlCe).sql @@ -2,11 +2,11 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1], - SUM([g_1].[ChildID]) as [SUM_1], - MIN([g_1].[ChildID]) as [MIN_1], - MAX([g_1].[ChildID]) as [MAX_1], - AVG([g_1].[ChildID]) as [AVG_1] + COUNT(*) as [Count_1], + SUM([g_1].[ChildID]) as [Sum_1], + MIN([g_1].[ChildID]) as [Min_1], + MAX([g_1].[ChildID]) as [Max_1], + AVG([g_1].[ChildID]) as [Average] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe).sql index a9f5714bb1c3..9a7fa150a093 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates2(SqlCe).sql @@ -2,11 +2,11 @@ -- SqlCe SELECT - SUM([g_1].[ChildID]) as [SUM_1], - MIN([g_1].[ChildID]) as [MIN_1], - MAX([g_1].[ChildID]) as [MAX_1], - AVG([g_1].[ChildID]) as [AVG_1], - COUNT(*) as [COUNT_1] + SUM([g_1].[ChildID]) as [Sum_1], + MIN([g_1].[ChildID]) as [Min_1], + MAX([g_1].[ChildID]) as [Max_1], + AVG([g_1].[ChildID]) as [Average], + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe).sql index 18fe161e975c..cc0cac257ead 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates3(SqlCe).sql @@ -5,23 +5,23 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 30 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], SUM(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [SUM_1], + END) as [Sum_1], MIN(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MAX(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [MAX_1], + END) as [Max_1], AVG(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [AVG_1] + END) as [Average] FROM [Child] [g_1] WHERE diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe).sql index 8f00b9f98edb..51f32394f6b6 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Aggregates4(SqlCe).sql @@ -5,11 +5,11 @@ SELECT COUNT(CASE WHEN [g_1].[ChildID] > 30 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], SUM(CASE WHEN [g_1].[ChildID] > 30 THEN [g_1].[ChildID] ELSE NULL - END) as [SUM_1] + END) as [Sum_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe).sql index d99f2d317fd9..af3032722020 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - AVG([t1].[ChildID]) as [AVG_1] + AVG([t1].[ChildID]) as [Average] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe).sql index f588fe60b7d4..0723d24a4e67 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Average2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - AVG([c_1].[ChildID]) as [AVG_1] + AVG([c_1].[ChildID]) as [Average] FROM [Child] [c_1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe).sql index 57ca2dc8d2f7..99357d386948 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.AverageInGroup(SqlCe).sql @@ -3,27 +3,27 @@ SELECT [g_2].[Key_1], - [g_2].[AVG_1], - [g_2].[AVG_2], - [g_2].[AVG_3], - [g_2].[AVG_4], - [t2].[AVG_1] as [AVG_5], - [t4].[AVG_1] as [AVG_6], - [t6].[AVG_1] as [AVG_7] + [g_2].[Average], + [g_2].[Average_1], + [g_2].[Average_2], + [g_2].[Average_3], + [t2].[Average] as [Average_4], + [t4].[Average] as [Average_5], + [t6].[Average] as [Average_6] FROM ( SELECT [g_1].[GroupId] as [Key_1], - AVG([g_1].[DataValue]) as [AVG_1], - AVG([g_1].[DataValue]) as [AVG_2], + AVG([g_1].[DataValue]) as [Average], + AVG([g_1].[DataValue]) as [Average_1], AVG(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [AVG_3], + END) as [Average_2], AVG(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [AVG_4] + END) as [Average_3] FROM [AggregationData] [g_1] WHERE @@ -33,7 +33,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - AVG([t1].[DataValue]) as [AVG_1] + AVG([t1].[DataValue]) as [Average] FROM ( SELECT DISTINCT @@ -46,7 +46,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - AVG([t3].[DataValue]) as [AVG_1] + AVG([t3].[DataValue]) as [Average] FROM ( SELECT DISTINCT @@ -60,7 +60,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - AVG([t5].[DataValue]) as [AVG_1] + AVG([t5].[DataValue]) as [Average] FROM ( SELECT DISTINCT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe).sql index e35ab065fc20..2b7ba35067d6 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.ByJoin(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([c2].[ChildID]) as [SUM_1] + SUM([c2].[ChildID]) as [Sum_1] FROM [Child] [g_1] INNER JOIN [Child] [c2] ON [g_1].[ChildID] = [c2].[ChildID] + 1 diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe).sql index 534935ae0afe..f2c457af80f4 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CalcMember(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [groupedData_1].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe).sql index b9f7d065e206..f74073a96e4a 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe).sql index 713993a9c371..ecb61d70b1c3 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] INNER JOIN [Parent] [p] ON [c_1].[ParentID] = [p].[ParentID] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe).sql index fb4c54af1077..e9fcc3b8cadc 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountGroupBy3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe).sql index f008635d8f0c..363707426177 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlCe).sql @@ -2,40 +2,40 @@ -- SqlCe SELECT - [t9].[Key_1], - [t9].[COUNT_1], - [t9].[COUNT_2], - [t9].[COUNT_3], - [t2].[COUNT_1] as [COUNT_4], - [t3].[COUNT_1] as [COUNT_5], - [t5].[COUNT_1] as [COUNT_6], - [t6].[COUNT_1] as [COUNT_7], - [t9].[COUNT_4] as [COUNT_8], - [t8].[COUNT_1] as [COUNT_9] + [t11].[Key_1], + [t11].[Count_1], + [t11].[Count_2], + [t11].[Count_3], + [t2].[Count_1] as [Count_4], + [t4].[Count_1] as [Count_5], + [t6].[Count_1] as [Count_6], + [t8].[Count_1] as [Count_7], + [t11].[Count_4] as [Count_8], + [t10].[Count_1] as [Count_9] FROM ( SELECT [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(CASE WHEN CAST([t].[DataValue] AS Int) % 2 = 0 THEN 1 ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], + END) as [Count_2], + COUNT(*) as [Count_3], COUNT(CASE WHEN CAST([t].[DataValue] AS Int) % 2 = 0 THEN 1 ELSE NULL - END) as [COUNT_4] + END) as [Count_4] FROM [AggregationData] [t] WHERE [t].[DataValue] IS NOT NULL GROUP BY [t].[GroupId] - ) [t9] + ) [t11] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -43,12 +43,12 @@ FROM FROM [AggregationData] [t_1] WHERE - [t_1].[DataValue] IS NOT NULL AND [t9].[Key_1] = [t_1].[GroupId] + [t_1].[DataValue] IS NOT NULL AND [t11].[Key_1] = [t_1].[GroupId] ) [t1] ) [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -56,14 +56,13 @@ FROM FROM [AggregationData] [x] WHERE - [x].[DataValue] IS NOT NULL AND [t9].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - CAST([x_1].[DataValue] AS Int) % 2 = 0 - ) [t3] + [x].[DataValue] IS NOT NULL AND [t11].[Key_1] = [x].[GroupId] AND + CAST([x].[DataValue] AS Int) % 2 = 0 + ) [t3] + ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -71,29 +70,27 @@ FROM FROM [AggregationData] [t_2] WHERE - [t_2].[DataValue] IS NOT NULL AND [t9].[Key_1] = [t_2].[GroupId] AND + [t_2].[DataValue] IS NOT NULL AND [t11].[Key_1] = [t_2].[GroupId] AND CAST([t_2].[DataValue] AS Int) % 2 = 0 - ) [t4] - ) [t5] + ) [t5] + ) [t6] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT - [x_2].[DataValue] + [x_1].[DataValue] FROM - [AggregationData] [x_2] + [AggregationData] [x_1] WHERE - [x_2].[DataValue] IS NOT NULL AND [t9].[Key_1] = [x_2].[GroupId] AND - CAST([x_2].[DataValue] AS Int) % 2 = 0 - ) [x_3] - WHERE - CAST([x_3].[DataValue] AS Int) % 2 = 0 - ) [t6] + [x_1].[DataValue] IS NOT NULL AND [t11].[Key_1] = [x_1].[GroupId] AND + CAST([x_1].[DataValue] AS Int) % 2 = 0 + ) [t7] + ) [t8] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT @@ -101,10 +98,10 @@ FROM FROM [AggregationData] [t_3] WHERE - [t_3].[DataValue] IS NOT NULL AND [t9].[Key_1] = [t_3].[GroupId] AND + [t_3].[DataValue] IS NOT NULL AND [t11].[Key_1] = [t_3].[GroupId] AND CAST([t_3].[DataValue] AS Int) % 2 = 0 - ) [t7] - ) [t8] + ) [t9] + ) [t10] BeforeExecute -- SqlCe diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe).sql index c7137cf7c734..012d1492006c 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy1(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[Max_1]) as [SUM_1] + SUM([g_2].[Max_1]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe).sql index c7137cf7c734..012d1492006c 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.DoubleGroupBy2(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[Max_1]) as [SUM_1] + SUM([g_2].[Max_1]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.EmptySetAggregateNullability(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.EmptySetAggregateNullability(SqlCe).sql index 16d7c19f28ae..9467142b7049 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.EmptySetAggregateNullability(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.EmptySetAggregateNullability(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -19,7 +19,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -53,7 +53,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -70,7 +70,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe).sql index d3d5ee9a7111..82b18b8e2417 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlCe).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe).sql index 0c4ad6411171..3ca0269bb2cd 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstants(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [g_2].[ChildId], [g_2].[ParentId], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe).sql index 5d96a693ad01..1124f6fb2c71 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByConstantsEmpty(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [g_2].[ChildId], [g_2].[ParentId], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe).sql index edd822fc202e..3d01ba5c10eb 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCount(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe).sql index 3e9597a05be9..5cb12568f3a6 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe).sql index 3e9597a05be9..5cb12568f3a6 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByCustomEntity2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe).sql index 2099f1e20406..750deeb14b7e 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], [grp_1].[Year_1], [grp_1].[Month_1] FROM diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe).sql index 2099f1e20406..750deeb14b7e 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], [grp_1].[Year_1], [grp_1].[Month_1] FROM diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe).sql index 15ee1cb6aa86..01e64f1722d7 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByDate3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], DatePart(year, [grp_1].[Date_1]) as [Year_1], DatePart(month, [grp_1].[Date_1]) as [Month_1] FROM @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - SUM([grp_1].[MoneyValue]) as [SUM_1], + SUM([grp_1].[MoneyValue]) as [Sum_1], DatePart(year, [grp_1].[Date_1]) as [Year_1], DatePart(month, [grp_1].[Date_1]) as [Month_1] FROM diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe).sql index 9210e3610496..1021e39cf9f0 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByExpression2(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [t1].[ChildID] as [Key_1], - AVG([t1].[ParentID]) as [AVG_1] + AVG([t1].[ParentID]) as [Average] FROM [Child] [t1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe).sql index 7e69c59500d2..d7ec01472e39 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByMax(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([g_1].[ParentID]) as [MAX_1] + MAX([g_1].[ParentID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe).sql index e47fce8fec61..09861caf572f 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByNone(SqlCe).sql @@ -2,8 +2,8 @@ -- SqlCe SELECT - MIN([gr].[ParentID]) as [MIN_1], - MAX([gr].[ParentID]) as [MAX_1] + MIN([gr].[ParentID]) as [Min_1], + MAX([gr].[ParentID]) as [Max_1] FROM [Parent] [gr] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe).sql index 3f7682a16b71..dac2c800a8af 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByWithSubquery(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [t2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe).sql index 6cd1f5ed1813..69e3ea8c3368 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1078Test(SqlCe).sql @@ -3,11 +3,11 @@ SELECT [grp].[SiteID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(CASE WHEN [grp].[Active] = 0 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Issue1078Table] [grp] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe).sql index 3850e16bf6e1..ce49a7de7698 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue1198Test(SqlCe).sql @@ -5,7 +5,7 @@ SELECT TOP (1) COUNT(CASE WHEN [t].[Status] = 3 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Issue1192Table] [t] WHERE diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(SqlCe).sql index e5a090f4607c..b3eed1e7eb9e 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test1(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [gr].[FirstName], [gr].[LastName], - SUM([gr].[PersonID]) as [SUM_1] + SUM([gr].[PersonID]) as [Sum_1] FROM [Person] [gr] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(SqlCe).sql index e5a090f4607c..b3eed1e7eb9e 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue3486Test2(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [gr].[FirstName], [gr].[LastName], - SUM([gr].[PersonID]) as [SUM_1] + SUM([gr].[PersonID]) as [Sum_1] FROM [Person] [gr] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe).sql index e4f4d2b09349..a80ee3ab5953 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue5070Test(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [t_1].[FinalCustomerId], [t_1].[IsActive], - SUM([t_1].[Amount]) as [SUM_1] + SUM([t_1].[Amount]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue680Test(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue680Test(SqlCe).sql index 3802baa5a3f4..09a4347780e5 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue680Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue680Test(SqlCe).sql @@ -5,7 +5,7 @@ SELECT COUNT(CASE WHEN [g_1].[TimeStamp] > '2020-02-29 17:54:55.123' THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Issue680Table] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe).sql index 7944ec3b6068..43355780fe47 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue913Test(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_2].[cond], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe).sql index 3d60654819f7..99a18bf5d636 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.IssueGroupByNonTableColumn(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe).sql index ac5c0a7b4878..30392dc2c68f 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Issue_UnusedColumnsElimination(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe).sql index be0a9ab9500a..1919c1685a00 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([t1].[ChildID]) as [MAX_1] + MAX([t1].[ChildID]) as [Max_1] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe).sql index 74adf5565818..9dc76736a6c7 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max11(SqlCe).sql @@ -5,7 +5,7 @@ SELECT MAX(CASE WHEN [t1].[ChildID] > 20 THEN 1 ELSE 0 - END) as [MAX_1] + END) as [Max_1] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe).sql index 74adf5565818..9dc76736a6c7 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max12(SqlCe).sql @@ -5,7 +5,7 @@ SELECT MAX(CASE WHEN [t1].[ChildID] > 20 THEN 1 ELSE 0 - END) as [MAX_1] + END) as [Max_1] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe).sql index e26663c50339..1cb46a093918 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([p].[ParentID]) as [MAX_1] + MAX([p].[ParentID]) as [Max_1] FROM [Parent] [p] INNER JOIN [Child] [c_1] ON [p].[ParentID] = [c_1].[ParentID] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe).sql index 4448d4e215c7..b6a449b44ce6 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Max3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([c_1].[ChildID]) as [MAX_1] + MAX([c_1].[ChildID]) as [Max_1] FROM [Child] [c_1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe).sql index 95caf26d06f0..3aa2ab224b37 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MaxInGroup(SqlCe).sql @@ -3,27 +3,27 @@ SELECT [g_2].[GroupId], - [g_2].[MAX_1], - [g_2].[MAX_2], - [g_2].[MAX_3], - [g_2].[MAX_4], - [t2].[MAX_1] as [MAX_5], - [t4].[MAX_1] as [MAX_6], - [t6].[MAX_1] as [MAX_7] + [g_2].[Max_1], + [g_2].[Max_2], + [g_2].[Max_3], + [g_2].[Max_4], + [t2].[Max_1] as [Max_5], + [t4].[Max_1] as [Max_6], + [t6].[Max_1] as [Max_7] FROM ( SELECT [g_1].[GroupId], - MAX([g_1].[DataValue]) as [MAX_1], - MAX([g_1].[DataValue]) as [MAX_2], + MAX([g_1].[DataValue]) as [Max_1], + MAX([g_1].[DataValue]) as [Max_2], MAX(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MAX_3], + END) as [Max_3], MAX(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MAX_4] + END) as [Max_4] FROM [AggregationData] [g_1] GROUP BY @@ -31,7 +31,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - MAX([t1].[DataValue]) as [MAX_1] + MAX([t1].[DataValue]) as [Max_1] FROM ( SELECT DISTINCT @@ -44,7 +44,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - MAX([t3].[DataValue]) as [MAX_1] + MAX([t3].[DataValue]) as [Max_1] FROM ( SELECT DISTINCT @@ -57,7 +57,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - MAX([t5].[DataValue]) as [MAX_1] + MAX([t5].[DataValue]) as [Max_1] FROM ( SELECT DISTINCT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe).sql index 1d74438347d9..0427cb086700 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MIN([t1].[ChildID]) as [MIN_1] + MIN([t1].[ChildID]) as [Min_1] FROM [Child] [t1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe).sql index 23b4745e5c91..f2179110a6ca 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Min2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MIN([c_1].[ChildID]) as [MIN_1] + MIN([c_1].[ChildID]) as [Min_1] FROM [Child] [c_1] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe).sql index dbd9908ef124..ab4a446448f4 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.MinInGroup(SqlCe).sql @@ -3,27 +3,27 @@ SELECT [g_2].[GroupId], - [g_2].[MIN_1], - [g_2].[MIN_2], - [g_2].[MIN_3], - [g_2].[MIN_4], - [t2].[MIN_1] as [MIN_5], - [t4].[MIN_1] as [MIN_6], - [t6].[MIN_1] as [MIN_7] + [g_2].[Min_1], + [g_2].[Min_2], + [g_2].[Min_3], + [g_2].[Min_4], + [t2].[Min_1] as [Min_5], + [t4].[Min_1] as [Min_6], + [t6].[Min_1] as [Min_7] FROM ( SELECT [g_1].[GroupId], - MIN([g_1].[DataValue]) as [MIN_1], - MIN([g_1].[DataValue]) as [MIN_2], + MIN([g_1].[DataValue]) as [Min_1], + MIN([g_1].[DataValue]) as [Min_2], MIN(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MIN_3], + END) as [Min_3], MIN(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [MIN_4] + END) as [Min_4] FROM [AggregationData] [g_1] GROUP BY @@ -31,7 +31,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - MIN([t1].[DataValue]) as [MIN_1] + MIN([t1].[DataValue]) as [Min_1] FROM ( SELECT DISTINCT @@ -44,7 +44,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - MIN([t3].[DataValue]) as [MIN_1] + MIN([t3].[DataValue]) as [Min_1] FROM ( SELECT DISTINCT @@ -57,7 +57,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - MIN([t5].[DataValue]) as [MIN_1] + MIN([t5].[DataValue]) as [Min_1] FROM ( SELECT DISTINCT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe).sql index 04d102f985ad..c30bdd239752 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar101(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([g_1].[ChildID]) as [MAX_1] + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe).sql index 3c8e85b18813..8e67ae00df4c 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar5(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([g_1].[ParentID]) as [MAX_1] + MAX([g_1].[ParentID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe).sql index f86e2d459d08..50ee3eb1d7b7 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SelectMax(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([g_1].[ChildID]) as [MAX_1] + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe).sql index eeee99b58162..ef5af91b2532 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery3(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe).sql index eeee99b58162..ef5af91b2532 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery31(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe).sql index eeee99b58162..ef5af91b2532 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery32(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe).sql index 39706ece0a1f..b7fb67c6b020 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery4(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_2].[n], - SUM([g_2].[ParentID]) as [SUM_1] + SUM([g_2].[ParentID]) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe).sql index 5f85134c44e1..f55fbcc59b52 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SubQuery5(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Child] [g_1] LEFT JOIN [Parent] [p] ON [g_1].[ParentID] = [p].[ParentID] diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe).sql index 691dde2e6eab..d4e768921a2f 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([g_1].[ChildID]) as [SUM_1] + SUM([g_1].[ChildID]) as [Sum_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe).sql index 691dde2e6eab..d4e768921a2f 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - SUM([g_1].[ChildID]) as [SUM_1] + SUM([g_1].[ChildID]) as [Sum_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe).sql index 7db176f66937..79eea9d9209a 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Sum3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [t1].[SUM_1] + [t1].[Sum_1] FROM ( SELECT @@ -16,7 +16,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - SUM([a_Children].[ChildID]) as [SUM_1] + SUM([a_Children].[ChildID]) as [Sum_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe).sql index 56f0cb2f9d2c..dea879895fb9 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumInGroup(SqlCe).sql @@ -3,27 +3,27 @@ SELECT [g_2].[GroupId], - [g_2].[SUM_1], - [g_2].[SUM_2], - [g_2].[SUM_3], - [g_2].[SUM_4], - [t2].[SUM_1] as [SUM_5], - [t4].[SUM_1] as [SUM_6], - [t6].[SUM_1] as [SUM_7] + [g_2].[Sum_1], + [g_2].[Sum_2], + [g_2].[Sum_3], + [g_2].[Sum_4], + [t2].[Sum_1] as [Sum_5], + [t4].[Sum_1] as [Sum_6], + [t6].[Sum_1] as [Sum_7] FROM ( SELECT [g_1].[GroupId], - SUM([g_1].[DataValue]) as [SUM_1], - SUM([g_1].[DataValue]) as [SUM_2], + SUM([g_1].[DataValue]) as [Sum_1], + SUM([g_1].[DataValue]) as [Sum_2], SUM(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [SUM_3], + END) as [Sum_3], SUM(CASE WHEN CAST([g_1].[DataValue] AS Int) % 2 = 0 THEN [g_1].[DataValue] ELSE NULL - END) as [SUM_4] + END) as [Sum_4] FROM [AggregationData] [g_1] GROUP BY @@ -31,7 +31,7 @@ FROM ) [g_2] OUTER APPLY ( SELECT - SUM([t1].[DataValue]) as [SUM_1] + SUM([t1].[DataValue]) as [Sum_1] FROM ( SELECT DISTINCT @@ -44,7 +44,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - SUM([t3].[DataValue]) as [SUM_1] + SUM([t3].[DataValue]) as [Sum_1] FROM ( SELECT DISTINCT @@ -57,7 +57,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - SUM([t5].[DataValue]) as [SUM_1] + SUM([t5].[DataValue]) as [Sum_1] FROM ( SELECT DISTINCT diff --git a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe).sql b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe).sql index 49a0376d8834..3d66bf97c7a0 100644 --- a/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe).sql +++ b/SqlCe/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.SumSubQuery1(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @n Int -- Int32 SET @n = 1 SELECT - SUM([g_2].[ParentID] - 3) as [SUM_1] + SUM([g_2].[ParentID] - 3) as [Sum_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe).sql b/SqlCe/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe).sql index 86a24036397c..7e43f892272d 100644 --- a/SqlCe/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/InterfaceTests/Tests.Linq.InterfaceTests.Test(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [gr] GROUP BY diff --git a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,2).sql b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,2).sql index 3c5334da089b..4f5b2e4c61df 100644 --- a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,2).sql +++ b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,2).sql @@ -4,7 +4,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value Int -- Int32 SET @value = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,4).sql b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,4).sql index 1a882693c727..ab69bb72e345 100644 --- a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,4).sql +++ b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,4).sql @@ -4,7 +4,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value Int -- Int32 SET @value = 4 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,null).sql b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,null).sql index d6fed5709ae9..aae443dd85cc 100644 --- a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,null).sql +++ b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Ints(SqlCe,null).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] @@ -10,7 +10,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,abc).sql b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,abc).sql index 8aa2c15c6804..48c55022198f 100644 --- a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,abc).sql +++ b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,abc).sql @@ -4,7 +4,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'abc' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,null).sql b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,null).sql index d1b834f0df45..3165186aa173 100644 --- a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,null).sql +++ b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,null).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,xyz).sql b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,xyz).sql index 5ac81e894fd7..0b5795b030b9 100644 --- a/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,xyz).sql +++ b/SqlCe/Tests/Linq/IsDistinctFromTests/Tests.Linq.IsDistinctFromTests.Strings(SqlCe,xyz).sql @@ -4,7 +4,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -16,7 +16,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -28,7 +28,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE @@ -40,7 +40,7 @@ DECLARE @value NVarChar(3) -- String SET @value = 'xyz' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Src] [s] WHERE diff --git a/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue38Test(SqlCe).sql b/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue38Test(SqlCe).sql index efddc8d4195a..4ab5fdbe7a24 100644 --- a/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue38Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue38Test(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Child] [a] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren1] WHERE diff --git a/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe).sql b/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe).sql index 630d6b226a3d..f0f7f89aa5a5 100644 --- a/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue498Test(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] INNER JOIN [GrandChild] [y] ON [g_1].[ParentID] = [y].[ParentID] AND [g_1].[ChildID] = [y].[ChildID] diff --git a/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe).sql b/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe).sql index 70ecd7411a2c..2e89dcbc9090 100644 --- a/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/IssueTests/Tests.Linq.IssueTests.Issue75Test(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [c_1].[ChildID], [c_1].[ParentID], - [t1].[COUNT_1], + [t1].[Count_1], CASE WHEN EXISTS( SELECT @@ -29,13 +29,13 @@ SELECT THEN 1 ELSE 0 END as [AllChildren], - [t2].[MIN_1], - [t3].[MAX_1] + [t2].[Min_1], + [t3].[Max_1] FROM [Child] [c_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c2] WHERE @@ -43,7 +43,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - MIN([c2_1].[ChildID]) as [MIN_1] + MIN([c2_1].[ChildID]) as [Min_1] FROM [Child] [c2_1] WHERE @@ -51,7 +51,7 @@ FROM ) [t2] OUTER APPLY ( SELECT - MAX([c2_2].[ChildID]) as [MAX_1] + MAX([c2_2].[ChildID]) as [Max_1] FROM [Child] [c2_2] WHERE diff --git a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe).sql b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe).sql index fb0f5a3e47ff..de491a648680 100644 --- a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe).sql +++ b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.BltIssue257(SqlCe).sql @@ -3,7 +3,7 @@ SELECT [b_1].[Date_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe).sql b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe).sql index 3d391546bd9a..b7afce2b3265 100644 --- a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe).sql +++ b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.GroupJoin54(SqlCe).sql @@ -2,14 +2,14 @@ -- SqlCe SELECT - [t1].[COUNT_1], + [t1].[Count_1], [t2].[ParentID], [t2].[ChildID] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [ch] WHERE diff --git a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe).sql b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe).sql index 88e7d613199f..047407cdb832 100644 --- a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe).sql +++ b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlCe).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe).sql b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe).sql index 662f7e918970..66d7b2d1f01d 100644 --- a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe).sql +++ b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlCe).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe).sql b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe).sql index b310fff42123..bb7dac105972 100644 --- a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe).sql +++ b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQueryCount(SqlCe).sql @@ -5,12 +5,12 @@ SET @n = 1 SELECT [p].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe).sql b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe).sql index e40e540dfeeb..d07f4e6228a0 100644 --- a/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe).sql +++ b/SqlCe/Tests/Linq/JoinTests/Tests.Linq.JoinTests.JoinSubQuerySum(SqlCe).sql @@ -3,12 +3,12 @@ SELECT [p].[ParentID], - [t1].[SUM_1] + [t1].[Sum_1] FROM [Parent] [p] OUTER APPLY ( SELECT - SUM([c_1].[ChildID]) as [SUM_1] + SUM([c_1].[ChildID]) as [Sum_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe).sql b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe).sql index ecd3e2838ba7..17325f109149 100644 --- a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe).sql +++ b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith3(SqlCe).sql @@ -22,14 +22,14 @@ BeforeExecute -- SqlCe SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe).sql b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe).sql index ecd3e2838ba7..17325f109149 100644 --- a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe).sql +++ b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith4(SqlCe).sql @@ -22,14 +22,14 @@ BeforeExecute -- SqlCe SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe).sql b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe).sql index 548e1d0e71fa..25f9a4cd6087 100644 --- a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe).sql +++ b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith5(SqlCe).sql @@ -55,14 +55,14 @@ BeforeExecute -- SqlCe SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe).sql b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe).sql index 020e43f04f84..dbe0444c7a16 100644 --- a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe).sql +++ b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWith6(SqlCe).sql @@ -25,14 +25,14 @@ BeforeExecute -- SqlCe SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[ChildID] FROM [Child] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe).sql b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe).sql index ecd3e2838ba7..17325f109149 100644 --- a/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe).sql +++ b/SqlCe/Tests/Linq/LoadWithTests/Tests.Linq.LoadWithTests.LoadWithAsTable3(SqlCe).sql @@ -22,14 +22,14 @@ BeforeExecute -- SqlCe SELECT - [t1].[COUNT_1], + [t1].[Count_1], [p].[ParentID], [p].[Value1] FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe).sql b/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe).sql index 6a6c75cb7edd..41d14f8b592a 100644 --- a/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe).sql +++ b/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.Enum812(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [p] WHERE diff --git a/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe).sql b/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe).sql index 413bd7a1cbba..70813eaa7fd7 100644 --- a/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe).sql +++ b/SqlCe/Tests/Linq/MappingTests/Tests.Linq.MappingTests.TestInterfaceMapping1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe).sql index 5ac11f9b18fe..0c19633afaec 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlCe).sql @@ -2,13 +2,18 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (CAST(FLOOR([p].[MoneyValue]) AS Int) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (CAST(FLOOR([t].[MoneyValue]) AS Int) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe).sql index a9dd79337fdc..6e1cc839a555 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe).sql index 0d8066215f7a..88987492fc7b 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlCe).sql @@ -2,13 +2,18 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,1).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,1).sql index f7d8c1a3f12c..bb3c89c572bc 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,1).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,2).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,2).sql index f7d8c1a3f12c..bb3c89c572bc 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,2).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,1).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,1).sql index a9dd79337fdc..6e1cc839a555 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,1).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,2).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,2).sql index a9dd79337fdc..6e1cc839a555 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,2).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlCe,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe).sql index bc076fa0373e..cf83b6127003 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlCe).sql @@ -2,13 +2,18 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([p].[MoneyValue] AS Float)) AS Int) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([t].[MoneyValue] AS Float)) AS Int) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe).sql index a9dd79337fdc..6e1cc839a555 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe).sql index 0d8066215f7a..88987492fc7b 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlCe).sql @@ -2,13 +2,18 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe).sql index 8c180949239f..0a02911b30e9 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlCe).sql @@ -2,9 +2,14 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe).sql index 49363838a1e7..3f12ab42e72c 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlCe).sql @@ -2,9 +2,14 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe).sql index 5ac11f9b18fe..0c19633afaec 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlCe).sql @@ -2,13 +2,18 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (CAST(FLOOR([p].[MoneyValue]) AS Int) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (CAST(FLOOR([t].[MoneyValue]) AS Int) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe).sql index bc076fa0373e..cf83b6127003 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlCe).sql @@ -2,13 +2,18 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([p].[MoneyValue] AS Float)) AS Int) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (CAST(FLOOR(CAST([t].[MoneyValue] AS Float)) AS Int) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe).sql b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe).sql index 427f27419e6d..e0b846e5187f 100644 --- a/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe).sql +++ b/SqlCe/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlCe).sql @@ -2,9 +2,14 @@ -- SqlCe SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe).sql b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe).sql index 2fbf0234926d..a70a9dc7561a 100644 --- a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe).sql +++ b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlCe).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlCe @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlCe @@ -78,9 +78,9 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -88,9 +88,9 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlCe @@ -109,21 +109,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe @@ -142,21 +142,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe @@ -172,19 +172,19 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe).sql b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe).sql index 2fbf0234926d..a70a9dc7561a 100644 --- a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe).sql +++ b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlCe).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlCe @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlCe @@ -78,9 +78,9 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -88,9 +88,9 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlCe @@ -109,21 +109,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe @@ -142,21 +142,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlCe @@ -172,19 +172,19 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe).sql b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe).sql index f9626bda110b..8215399f0c24 100644 --- a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe).sql +++ b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlCe).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlCe @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlCe @@ -78,21 +78,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlCe @@ -111,21 +111,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe @@ -144,21 +144,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe @@ -174,19 +174,19 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe).sql b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe).sql index f9626bda110b..8215399f0c24 100644 --- a/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe).sql +++ b/SqlCe/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlCe).sql @@ -15,21 +15,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'abc' OR [x].[String] IS NULL + [s].[String] = 'abc' OR [s].[String] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = 'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlCe @@ -48,21 +48,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = 'xyz' OR [x].[String] IS NULL + [s].[String] = 'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = 'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = 'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlCe @@ -78,21 +78,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlCe @@ -111,21 +111,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe @@ -144,21 +144,21 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = 'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = 'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlCe @@ -174,19 +174,19 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlCe/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe).sql b/SqlCe/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe).sql index 195b3ef935a7..e4248d04af99 100644 --- a/SqlCe/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByDistinctTests/Tests.Linq.OrderByDistinctTests.OrderBySubQuery(SqlCe).sql @@ -5,7 +5,7 @@ SET @take = 2 SELECT [t_1].[DuplicateData], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT TOP (@take) @@ -16,7 +16,7 @@ FROM ) [t_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [OrderByDistinctData] [c_1] WHERE diff --git a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe).sql b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe).sql index 96fd704d3a8e..e149107b5999 100644 --- a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] diff --git a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe).sql b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe).sql index 3648e39717a5..22e195aa7ce3 100644 --- a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Count2(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 3 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe).sql b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe).sql index 6a996e2c66f2..26cd9e902000 100644 --- a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MIN([t1].[ParentID]) as [MIN_1] + MIN([t1].[ParentID]) as [Min_1] FROM [Parent] [t1] diff --git a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe).sql b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe).sql index 271df57e3897..aef00a033e0e 100644 --- a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min2(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 3 SELECT - MIN([t2].[ParentID]) as [MIN_1] + MIN([t2].[ParentID]) as [Min_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe).sql b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe).sql index 8d0691f963e8..3dae55295442 100644 --- a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.Min3(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 3 SELECT - MIN([t2].[ParentID]) as [MIN_1] + MIN([t2].[ParentID]) as [Min_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe).sql b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe).sql index 8be6e1abd33c..07ffc31892f6 100644 --- a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByAndGroupByConstant(SqlCe).sql @@ -4,9 +4,9 @@ DECLARE @take Int -- Int32 SET @take = 1 SELECT TOP (@take) - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], 1 + MIN([g_1].[ChildID]) as [c1], - MAX([g_1].[ChildID]) as [MAX_1] + MAX([g_1].[ChildID]) as [Max_1] FROM [Child] [g_1] diff --git a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe).sql b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe).sql index b5e98323eb9c..a63df568b45a 100644 --- a/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe).sql +++ b/SqlCe/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlCe).sql @@ -8,7 +8,7 @@ FROM [Parent] [p] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -17,5 +17,5 @@ FROM INNER JOIN [Parent] [pp] ON [p].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe).sql b/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe).sql index 956c5d1700c6..2edef3a9d7ca 100644 --- a/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe).sql +++ b/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestOptimizingParameters(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @id Int -- Int32 SET @id = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe).sql b/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe).sql index b01fa53382aa..6dbf93b299b9 100644 --- a/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe).sql +++ b/SqlCe/Tests/Linq/ParameterTests/Tests.Linq.ParameterTests.TestQueryCacheWithNullParameters(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE @@ -14,7 +14,7 @@ DECLARE @id Int -- Int32 SET @id = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,False).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,False).sql index 1f773e3fc4ea..93a96b98a897 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -23,7 +23,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -35,8 +35,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -44,8 +44,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -76,7 +76,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -88,8 +88,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -97,8 +97,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -129,7 +129,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -140,8 +140,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -172,7 +172,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -183,8 +183,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -215,7 +215,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -231,16 +231,16 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -274,7 +274,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -290,16 +290,16 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -333,7 +333,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -348,8 +348,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -383,7 +383,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -398,8 +398,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -433,7 +433,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -445,8 +445,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -454,8 +454,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -463,8 +463,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -495,7 +495,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -507,8 +507,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -516,8 +516,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -525,8 +525,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -557,7 +557,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -568,13 +568,13 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -605,7 +605,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -616,13 +616,13 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -653,7 +653,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -669,24 +669,24 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -720,7 +720,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -736,24 +736,24 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -787,7 +787,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -802,12 +802,12 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -841,7 +841,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -856,12 +856,12 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -895,14 +895,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -931,14 +931,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -967,14 +967,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1003,14 +1003,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1039,14 +1039,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1075,14 +1075,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1111,14 +1111,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1147,14 +1147,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1183,7 +1183,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1194,7 +1194,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1226,7 +1226,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1237,7 +1237,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1269,7 +1269,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1280,7 +1280,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1312,7 +1312,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1323,7 +1323,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1355,7 +1355,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1366,7 +1366,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1398,7 +1398,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1409,7 +1409,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1441,7 +1441,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1452,7 +1452,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1484,7 +1484,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1495,7 +1495,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,True).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,True).sql index 1f773e3fc4ea..93a96b98a897 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_ComplexPredicateComparisonWithUnknown(SqlCe,True).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -23,7 +23,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -35,8 +35,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -44,8 +44,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -76,7 +76,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -88,8 +88,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -97,8 +97,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -129,7 +129,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -140,8 +140,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -172,7 +172,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -183,8 +183,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END @@ -215,7 +215,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -231,16 +231,16 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -274,7 +274,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -290,16 +290,16 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -333,7 +333,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -348,8 +348,8 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -383,7 +383,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -398,8 +398,8 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END = CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END THEN 1 @@ -433,7 +433,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -445,8 +445,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -454,8 +454,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -463,8 +463,8 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -495,7 +495,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -507,8 +507,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE @@ -516,8 +516,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE @@ -525,8 +525,8 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -557,7 +557,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -568,13 +568,13 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -605,7 +605,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -616,13 +616,13 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL @@ -653,7 +653,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -669,24 +669,24 @@ WHERE WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] = [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] = [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -720,7 +720,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -736,24 +736,24 @@ WHERE WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NOT NULL OR CASE WHEN ([r_1].[Value1] <> [r_1].[Value4]) THEN 1 WHEN NOT ([r_1].[Value1] <> [r_1].[Value4]) THEN 0 ELSE NULL END IS NOT NULL AND CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -787,7 +787,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -802,12 +802,12 @@ WHERE WHEN ([r_1].[Value1] = [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -841,7 +841,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -856,12 +856,12 @@ WHERE WHEN ([r_1].[Value1] <> [r_1].[Value2]) THEN 1 ELSE 0 END <> CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END OR CASE - WHEN ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 1 - WHEN NOT ([t1].[COUNT_1] = ([r_1].[Value5] + @cnt)) THEN 0 + WHEN ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 1 + WHEN NOT ([t1].[Count_1] = ([r_1].[Value5] + @cnt)) THEN 0 ELSE NULL END IS NULL THEN 1 @@ -895,14 +895,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -931,14 +931,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -967,14 +967,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1003,14 +1003,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1039,14 +1039,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1075,14 +1075,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1111,14 +1111,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1147,14 +1147,14 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE [r].[Value1] = 1 ) [t1] ON 1=1 WHERE - ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) BeforeExecute -- SqlCe @@ -1183,7 +1183,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1194,7 +1194,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1226,7 +1226,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1237,7 +1237,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1269,7 +1269,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1280,7 +1280,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1312,7 +1312,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1323,7 +1323,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value4] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value4] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1355,7 +1355,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1366,7 +1366,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) >= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) >= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1398,7 +1398,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1409,7 +1409,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) > ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) > ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1441,7 +1441,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1452,7 +1452,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) <= ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) <= ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END @@ -1484,7 +1484,7 @@ FROM [BooleanTable] [r_1] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [BooleanTable] [r] WHERE @@ -1495,7 +1495,7 @@ WHERE WHEN (1=1) THEN 1 ELSE 0 END = CASE - WHEN ([r_1].[Value2] + @cnt) < ([t1].[COUNT_1] + [r_1].[Value5]) + WHEN ([r_1].[Value2] + @cnt) < ([t1].[Count_1] + [r_1].[Value5]) THEN 1 ELSE 0 END diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_False(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_False(SqlCe).sql index 0f72afd5d0bd..8bb839467845 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_False(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_False(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_Null(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_Null(SqlCe).sql index 88d1898f562e..a31d80539098 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_Null(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_Null(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_True(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_True(SqlCe).sql index 38c8a15a0f16..a379bd18b59c 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_True(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_BooleanAsPredicate_True(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedFalse(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedFalse(SqlCe).sql index c9b9711f68e9..18deb0b2b6fa 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedFalse(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedFalse(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedTrue(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedTrue(SqlCe).sql index 2add05c856c9..725c492dc4d7 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedTrue(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedTrue(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedUnknown(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedUnknown(SqlCe).sql index e9c3c97cf297..672f736c1055 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedUnknown(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_CalculatedUnknown(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Decode(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Decode(SqlCe).sql index b5a21066b492..119838645730 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Decode(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Decode(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_DistinctFrom(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_DistinctFrom(SqlCe).sql index ef4df25b9529..4c25a7ad8256 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_DistinctFrom(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_DistinctFrom(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_False(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_False(SqlCe).sql index 8617c18b52ba..4caf7da45efc 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_False(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_False(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Intersect(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Intersect(SqlCe).sql index 91c5e119b053..cec692e466e2 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Intersect(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Intersect(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -38,7 +38,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -56,7 +56,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -76,7 +76,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -96,7 +96,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -116,7 +116,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -134,7 +134,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -152,7 +152,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -170,7 +170,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -190,7 +190,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE @@ -210,7 +210,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Is(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Is(SqlCe).sql index 5bd59ff364e9..bf5ebc6ed5db 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Is(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Is(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsFalse(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsFalse(SqlCe).sql index 4fc04ef65ffb..3d0d9deb18f1 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsFalse(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsFalse(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsNull(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsNull(SqlCe).sql index 397448321433..930ea0ccd9a3 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsNull(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsNull(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsTrue(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsTrue(SqlCe).sql index d5276772d992..fee47c968b2f 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsTrue(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsTrue(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsUnknown(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsUnknown(SqlCe).sql index bd2a3368e3c8..fda148e70a8a 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsUnknown(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_IsUnknown(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_NullSaveEqual(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_NullSaveEqual(SqlCe).sql index fa61e9d5367a..85bfc185901c 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_NullSaveEqual(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_NullSaveEqual(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_PredicateComparison(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_PredicateComparison(SqlCe).sql index 09df51277237..b3ba982995ae 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_PredicateComparison(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_PredicateComparison(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_True(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_True(SqlCe).sql index 9947d8e1fbe7..f315def5a550 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_True(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_True(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Unknown(SqlCe).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Unknown(SqlCe).sql index 20dc02574f02..7eb381bc1a3d 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Unknown(SqlCe).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_Feature_Unknown(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [FeatureTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,False).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,False).sql index 76996011940b..34f1b7677c32 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,False).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -34,7 +34,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -65,7 +65,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -96,7 +96,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -127,7 +127,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -158,7 +158,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -189,7 +189,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -221,7 +221,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -253,7 +253,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -284,7 +284,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -315,7 +315,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -346,7 +346,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -377,7 +377,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -408,7 +408,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -440,7 +440,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -471,7 +471,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -502,7 +502,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -533,7 +533,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -564,7 +564,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -595,7 +595,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -627,7 +627,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -658,7 +658,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -689,7 +689,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -720,7 +720,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,True).sql b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,True).sql index 76996011940b..34f1b7677c32 100644 --- a/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/PredicateTests/Tests.Linq.PredicateTests.Test_PredicateAsNonConditionBooleanValue_Test2(SqlCe,True).sql @@ -3,7 +3,7 @@ SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -34,7 +34,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -65,7 +65,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -96,7 +96,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -127,7 +127,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -158,7 +158,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -189,7 +189,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -221,7 +221,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -253,7 +253,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -284,7 +284,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -315,7 +315,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -346,7 +346,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -377,7 +377,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -408,7 +408,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -440,7 +440,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -471,7 +471,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -502,7 +502,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -533,7 +533,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -564,7 +564,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -595,7 +595,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -627,7 +627,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -658,7 +658,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -689,7 +689,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT @@ -720,7 +720,7 @@ BeforeExecute SELECT [g_2].[Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe).sql b/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe).sql index a14e4e8be534..3f0eb60dba25 100644 --- a/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe).sql +++ b/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithCast(SqlCe).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT TOP (@take) [a_Patient].[Diagnosis], [a_Patient].[PersonID], - AVG([auto16031].[PersonID]) as [AVG_1] + AVG([auto16031].[PersonID]) as [Average] FROM [Person] [auto16031] LEFT JOIN [Patient] [a_Patient] ON [auto16031].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe).sql b/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe).sql index 99bf9c5b593f..703c10c765bc 100644 --- a/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe).sql +++ b/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithToNullable(SqlCe).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT TOP (@take) [a_Patient].[Diagnosis], [a_Patient].[PersonID] as [id], - AVG([auto16031].[PersonID]) as [AVG_1] + AVG([auto16031].[PersonID]) as [Average] FROM [Person] [auto16031] LEFT JOIN [Patient] [a_Patient] ON [auto16031].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe).sql b/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe).sql index a14e4e8be534..3f0eb60dba25 100644 --- a/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe).sql +++ b/SqlCe/Tests/Linq/ProjectionTests/Tests.Linq.ProjectionTests.GroupByWithTwoCasts(SqlCe).sql @@ -6,7 +6,7 @@ SET @take = 1000 SELECT TOP (@take) [a_Patient].[Diagnosis], [a_Patient].[PersonID], - AVG([auto16031].[PersonID]) as [AVG_1] + AVG([auto16031].[PersonID]) as [Average] FROM [Person] [auto16031] LEFT JOIN [Patient] [a_Patient] ON [auto16031].[PersonID] = [a_Patient].[PersonID] diff --git a/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe).sql b/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe).sql index 40921165cd9a..12408b59af38 100644 --- a/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe).sql +++ b/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.SelectManyLeftJoinCount(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] LEFT JOIN [Child] [c_1] ON [t1].[ParentID] = [c_1].[ParentID] diff --git a/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe).sql b/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe).sql index c6a48d839d17..ba3731f4773c 100644 --- a/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe).sql +++ b/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] INNER JOIN [GrandChild] [g_1] ON [t1].[ParentID] = [g_1].[ParentID] diff --git a/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe).sql b/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe).sql index 3dcb17a0241b..a12803e5c390 100644 --- a/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe).sql +++ b/SqlCe/Tests/Linq/SelectManyTests/Tests.Linq.SelectManyTests.Test4(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] INNER JOIN [GrandChild] [g_1] ON [t1].[ParentID] = [g_1].[ParentID] diff --git a/SqlCe/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe).sql b/SqlCe/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe).sql index 3b81c21bdc57..d32f327fa1c3 100644 --- a/SqlCe/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/SelectTests/Tests.Linq.SelectTests.Issue4198Test(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [a] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe).sql index d9b3f55067be..5dd4766c900a 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Between(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -43,7 +43,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -54,7 +54,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -65,7 +65,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -75,7 +75,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -86,7 +86,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -97,7 +97,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,1).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,1).sql index cad53506ea3e..d6ae9d7e3610 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,1).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,1).sql @@ -4,7 +4,7 @@ DECLARE @r3 Int -- Int32 SET @r3 = 1 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,2).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,2).sql index e017b3684f4c..7f4a05ae4e52 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,2).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,2).sql @@ -4,7 +4,7 @@ DECLARE @r3 Int -- Int32 SET @r3 = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,3).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,3).sql index 1cee1b7fe939..6fd8f6fdd81f 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,3).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Caching(SqlCe,3).sql @@ -4,7 +4,7 @@ DECLARE @r3 Int -- Int32 SET @r3 = 3 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe).sql index 22804d131d6c..328e5353cba8 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Equals(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe).sql index ec971d13d947..dd618e732856 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Greater(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe).sql index 2524cb554071..e81e69a61a93 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.GreaterEquals(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe).sql index 4dd147ed20d9..bacac5608444 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.In(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe).sql index ab3da42f7c3f..18abab5145c2 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNotNull(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] @@ -10,7 +10,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe).sql index e7b227374dbd..872d74e236d4 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.IsNull(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe).sql index 3bdd0ea00d03..2996df1104ca 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.Less(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe).sql index 2dab88aa4044..20b8d3338aed 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.LessEquals(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe).sql index afbb2b38946b..0836c3da0544 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.MixedTypes(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Mixed] [t] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe).sql index af20f6755ece..b4d8753f7e05 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotBetween(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -52,7 +52,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -62,7 +62,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -72,7 +72,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -82,7 +82,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -92,7 +92,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe).sql index 77a41dd19f61..b5aa507a033c 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotEquals(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe).sql b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe).sql index 0575b0a97e2c..a4926aa90160 100644 --- a/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe).sql +++ b/SqlCe/Tests/Linq/SqlRowTests/Tests.Linq.SqlRowTests.NotIn(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE @@ -48,7 +48,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Ints] [i] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe).sql index 159e33c9df13..3468ad96211e 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe).sql index 08c7cf8f9c0b..48b3de1f78aa 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant2(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe).sql index b2e63dc7ee6b..42fa4b6d11e5 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant3(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe).sql index d3a865938334..5657bdefacd6 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant4(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @s NVarChar(7) -- String SET @s = '123[456' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -16,7 +16,7 @@ DECLARE @s NVarChar(7) -- String SET @s = '123[456' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe).sql index f4e72031ffaa..8a150d4c7e49 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant41(SqlCe).sql @@ -6,7 +6,7 @@ DECLARE @ps NVarChar(3) -- String SET @ps = '%[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe).sql index 623e47d519e5..f03544ac3587 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant5(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe).sql index 389daa3f23a7..3de330e161b5 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsConstant51(SqlCe).sql @@ -4,7 +4,7 @@ DECLARE @ps NVarChar(3) -- String SET @ps = '%[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,#).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,#).sql index 2b54c241db9f..4d1d30ba8920 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,#).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,#).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%#%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,%).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,%).sql index fa5806888d0f..a82a36819a8d 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,%).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,%).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%~%%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,-).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,-).sql index ba11b3276011..5d1dcfc73766 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,-).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,-).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%-%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x002A).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x002A).sql index fba4a476476f..f99078f5524d 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x002A).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x002A).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%*%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x003F).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x003F).sql index 6b8ba0bb1d13..9b8be987be77 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x003F).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,0x003F).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%?%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[).sql index 18807d7e653a..b54e6786624d 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[[).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[[).sql index f076623b2479..2cd9f6f43d74 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[[).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[[).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%[[%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[]).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[]).sql index 95568797ac6d..cd896d7b17b2 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[]).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,[]).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%[]%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]).sql index 230f7620e172..c79dee78b2f0 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%]%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]]).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]]).sql index f87805ad5d47..8f28cd5298c6 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]]).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,]]).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(4) -- String SET @toTest = '%]]%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,n).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,n).sql index 3cca05d82dab..07a2952e8368 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,n).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsParameterAll(SqlCe,n).sql @@ -6,7 +6,7 @@ DECLARE @toTest NVarChar(3) -- String SET @toTest = '%n%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,#).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,#).sql index 0282a32ae699..c9456a8e7eb0 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,#).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,#).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,%).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,%).sql index e235f3898ed0..e11e7aa1c55a 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,%).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,%).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,-).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,-).sql index f97931e1d0b8..a2461f3dbe73 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,-).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,-).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x002A).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x002A).sql index a43da7cb40fe..dd4cd0c137c3 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x002A).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x002A).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x003F).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x003F).sql index 189ac761878e..f00329410bf4 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x003F).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,0x003F).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[).sql index 2a5708956fc0..25ade5e7d73d 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[[).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[[).sql index 8fa1db61f64e..45b2ce1e453f 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[[).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[[).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[]).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[]).sql index 9b0db70c98fb..39029bccc42a 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[]).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,[]).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]).sql index 6f443a4692cf..1140799a8a5f 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]]).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]]).sql index 5357a8cade4c..5a1306669a3d 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]]).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,]]).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,n).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,n).sql index b9b85494d6e5..ddae0e5a0c8a 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,n).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ContainsValueAll(SqlCe,n).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe).sql index e3d5c81aba9c..aa822a94c68a 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_Contains(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe).sql index b0b2bdd3f657..5523f14a622b 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_EndsWith(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe).sql index 0c780201ec18..bd4ac7c3b88e 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Default_StartsWith(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe).sql index a35884415ee6..4bf4068fef84 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithIgnoreCase(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe).sql index e3af762e5fa0..37b520ba084e 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.EndsWithWithCase(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE @@ -13,7 +13,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE @@ -35,7 +35,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe).sql index e3d5c81aba9c..aa822a94c68a 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_Contains(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe).sql index b0b2bdd3f657..5523f14a622b 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_EndsWith(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe).sql index 0c780201ec18..bd4ac7c3b88e 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinalIgnoreCase_StartsWith(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe).sql index 6537e8b8d034..f8a68678d8fe 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_EndsWith(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe).sql index 4942ad5e1473..963b1599451b 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.ExplicitOrdinal_StartsWith(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -40,7 +40,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE @@ -60,7 +60,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [CollatedTable] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe).sql index cf56c9c16c81..0d1776d90e16 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_EndsWith(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe).sql index 2844c19b8611..f9b21d05cf71 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Explicit_StartsWith(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -22,7 +22,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE @@ -32,7 +32,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Patient] [r] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe).sql index 75d99c52fe47..d6bb7c74be59 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.Issue3002Test(SqlCe).sql @@ -59,7 +59,7 @@ DECLARE @test_1 NVarChar(6) -- String SET @test_1 = '%Test%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SampleClass] [sampleClass_1] WHERE @@ -94,7 +94,7 @@ DECLARE @test_1 NVarChar(7) -- String SET @test_1 = '%Value%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SampleClass] [sampleClass_1] WHERE @@ -129,7 +129,7 @@ DECLARE @test_1 NVarChar(7) -- String SET @test_1 = '%Class%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SampleClass] [sampleClass_1] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe).sql index acf606e7d16e..af798e05873e 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1Case(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -13,7 +13,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -24,7 +24,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe).sql index 819eccb3ddc7..bed9616d5793 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWith1IgnoreCase(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -12,7 +12,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCulture).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCulture).sql index 7d41b80feb73..dde25c145ab2 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCulture).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCulture).sql @@ -16,7 +16,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -31,7 +31,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -61,7 +61,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCultureIgnoreCase).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCultureIgnoreCase).sql index cbb5adbca44d..f2e9764b64c4 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCultureIgnoreCase).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,InvariantCultureIgnoreCase).sql @@ -14,7 +14,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -26,7 +26,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,Ordinal).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,Ordinal).sql index 7d41b80feb73..dde25c145ab2 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,Ordinal).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,Ordinal).sql @@ -16,7 +16,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -31,7 +31,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'Joh' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -61,7 +61,7 @@ DECLARE @nameToCheck_1 NVarChar(3) -- String SET @nameToCheck_1 = 'JOH' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,OrdinalIgnoreCase).sql b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,OrdinalIgnoreCase).sql index cbb5adbca44d..f2e9764b64c4 100644 --- a/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,OrdinalIgnoreCase).sql +++ b/SqlCe/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.StartsWithCacheCheck(SqlCe,OrdinalIgnoreCase).sql @@ -14,7 +14,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -26,7 +26,7 @@ DECLARE @nameToCheck NVarChar(4) -- String SET @nameToCheck = 'JOH%' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE diff --git a/SqlCe/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlCe).sql b/SqlCe/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlCe).sql new file mode 100644 index 000000000000..19622532c244 --- /dev/null +++ b/SqlCe/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlCe).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlCe + +SELECT + Coalesce([t].[Value2], '') as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlCe + +SELECT + Coalesce([t].[Value3], '') as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlCe + +SELECT + SUBSTRING(Coalesce(' -> ' + [t].[Value3], '') + Coalesce(' -> ' + [t].[Value1], '') + Coalesce(' -> ' + [t].[Value2], ''), 5, 2147483647) as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlCe + +SELECT + SUBSTRING(Coalesce(' -> ' + [t].[Value3], '') + Coalesce(' -> ' + [t].[Value3], ''), 5, 2147483647) as [ConcatStrings] +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe).sql index fa3f5a133ee1..be3da10946ad 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlCe).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + * FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( + [m_1].[Id] = [a_Lines].[TransactionId] AND EXISTS( SELECT * FROM - [LineEntity] [a_Lines] + ( + SELECT 'A' AS [item] + UNION ALL + SELECT 'B' AS [item]) [t1] WHERE - [x].[Id] = [a_Lines].[TransactionId] AND EXISTS( - SELECT - * - FROM - ( - SELECT 'A' AS [item] - UNION ALL - SELECT 'B' AS [item]) [t1] - WHERE - [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL - ) + [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + ) BeforeExecute DisposeTransaction diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe).sql index f90de31a260b..92332dfabd52 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlCe).sql @@ -9,32 +9,27 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + * FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( + [m_1].[Id] = [a_Lines].[TransactionId] AND EXISTS( SELECT * FROM - [LineEntity] [a_Lines] + ( + SELECT 'A' AS [item] + UNION ALL + SELECT 'B' AS [item]) [t1] WHERE - [x].[Id] = [a_Lines].[TransactionId] AND EXISTS( - SELECT - * - FROM - ( - SELECT 'A' AS [item] - UNION ALL - SELECT 'B' AS [item]) [t1] - WHERE - [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL - ) + [a_Lines].[Currency] = [t1].[item] OR [a_Lines].[Currency] IS NULL AND [t1].[item] IS NULL ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + ) BeforeExecute DisposeTransaction diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe).sql index bbe105372b12..c9f0e20c507f 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4751Test(SqlCe).sql @@ -59,7 +59,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe).sql index 0c93612f92cd..afc0d1f6739e 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub1(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe).sql index 2ba39188e4c3..c6530efa391b 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub21(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe).sql index 3061c2b3bdb2..e3b60ddd7364 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub211(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Parent] [p1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] INNER JOIN [GrandChild] [g_1] ON [a_Children].[ParentID] = [g_1].[ParentID] AND [a_Children].[ChildID] = [g_1].[ChildID] diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe).sql index b1af6c144ff4..ddf3c2f65b42 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.SubSub212(SqlCe).sql @@ -2,13 +2,13 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Child] [p1] LEFT JOIN [Parent] [a_Parent] ON [p1].[ParentID] = [a_Parent].[ParentID] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [a_GrandChildren] WHERE diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe).sql index 8575d3021811..aa31cb4b4d6e 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test1(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[MAX_1] + [t1].[Max_1] FROM [Parent] [p] OUTER APPLY ( SELECT - MAX([ch].[ChildID]) as [MAX_1] + MAX([ch].[ChildID]) as [Max_1] FROM [Child] [ch] WHERE diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe).sql index 788c0e26f940..85bac4dc76bf 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test2(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[MAX_1] + [t1].[Max_1] FROM [Parent] [p] OUTER APPLY ( SELECT - MAX([ch].[ChildID]) as [MAX_1] + MAX([ch].[ChildID]) as [Max_1] FROM [Child] [ch] WHERE diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe).sql index 4b5c1fea5500..e50a7c7f21e2 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test5(SqlCe).sql @@ -5,8 +5,8 @@ SET @testValue = 3 SELECT [id_1].[c1], - [t1].[COUNT_1], - [t2].[COUNT_1] as [COUNT_2] + [t1].[Count_1], + [t2].[Count_1] as [Count_2] FROM ( SELECT DISTINCT @@ -21,7 +21,7 @@ FROM ) [id_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [p] WHERE @@ -29,7 +29,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [p_1] WHERE diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe).sql index 17764c98652e..e4055a66b7fa 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test6(SqlCe).sql @@ -6,13 +6,13 @@ SET @id = 2 SELECT [c_1].[ChildID], [c_1].[ParentID], - [t1].[SUM_1], - [t2].[COUNT_1] + [t1].[Sum_1], + [t2].[Count_1] FROM [Child] [c_1] OUTER APPLY ( SELECT - SUM([g_1].[ChildID] * [g_1].[GrandChildID]) as [SUM_1] + SUM([g_1].[ChildID] * [g_1].[GrandChildID]) as [Sum_1] FROM [GrandChild] [g_1] WHERE @@ -20,7 +20,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_2] WHERE diff --git a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe).sql b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe).sql index 9f588b27b280..41612cfdb4a4 100644 --- a/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe).sql +++ b/SqlCe/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Test7(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [t1].[COUNT_1] + [t1].[Count_1] FROM [Child] [c_1] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [g_1] WHERE diff --git a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,False).sql b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,False).sql index e61d857063af..1b13bcbe2fad 100644 --- a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,True).sql b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,True).sql index 96c3b2d552fb..e56343e51ac8 100644 --- a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.SkipCount(SqlCe,True).sql @@ -4,7 +4,7 @@ DECLARE @skip Int -- Int32 SET @skip = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,False).sql b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,False).sql index 4ff6df0349a3..d0893169b869 100644 --- a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,False).sql +++ b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,False).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT TOP (5) diff --git a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,True).sql b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,True).sql index 5265c65e0ab3..7670b7e48367 100644 --- a/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,True).sql +++ b/SqlCe/Tests/Linq/TakeSkipTests/Tests.Linq.TakeSkipTests.TakeCount(SqlCe,True).sql @@ -4,7 +4,7 @@ DECLARE @take Int -- Int32 SET @take = 5 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT TOP (@take) diff --git a/SqlCe/Tests/Linq/ValueConversionTests/Tests.Linq.ValueConversionTests.Insert(SqlCe).sql b/SqlCe/Tests/Linq/ValueConversionTests/Tests.Linq.ValueConversionTests.Insert(SqlCe).sql index 134fd9136afb..34b9b1499d14 100644 --- a/SqlCe/Tests/Linq/ValueConversionTests/Tests.Linq.ValueConversionTests.Insert(SqlCe).sql +++ b/SqlCe/Tests/Linq/ValueConversionTests/Tests.Linq.ValueConversionTests.Insert(SqlCe).sql @@ -177,7 +177,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [ValueConversion] [t1] diff --git a/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe).sql b/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe).sql index c49a88f263c5..b27fece60173 100644 --- a/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe).sql +++ b/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test1(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [a_Person].[personid], [a_Person].[personname], - MAX([VBIt].[added]) as [MAX_1] + MAX([VBIt].[added]) as [Max_1] FROM [activity649] [VBIt] INNER JOIN [person649] [a_Person] ON [VBIt].[personid] = [a_Person].[personid] diff --git a/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe).sql b/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe).sql index a0975e8cd230..8739c2c4c542 100644 --- a/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe).sql +++ b/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test3(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [a_Person].[personid], [a_Person].[personname], - MAX([f].[added]) as [MAX_1] + MAX([f].[added]) as [Max_1] FROM [activity649] [f] INNER JOIN [person649] [a_Person] ON [f].[personid] = [a_Person].[personid] diff --git a/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe).sql b/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe).sql index 641fd37d7094..1921d7d77430 100644 --- a/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe).sql +++ b/SqlCe/Tests/Linq/VisualBasicTests/Tests.Linq.VisualBasicTests.Issue649Test4(SqlCe).sql @@ -4,7 +4,7 @@ SELECT [data_1].[ParentID], [data_1].[ChildID], - MAX([data_1].[ChildID]) as [MAX_1] + MAX([data_1].[ChildID]) as [Max_1] FROM [Child] [data_1] GROUP BY diff --git a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe).sql b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe).sql index f2f03c96944f..1072b49c4db9 100644 --- a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe).sql +++ b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest1(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe).sql b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe).sql index 4042bfc4359c..0f4db977f929 100644 --- a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe).sql +++ b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlCe).sql @@ -2,12 +2,12 @@ -- SqlCe SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe).sql b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe).sql index ed2d5f4c9c8a..d747dc50756b 100644 --- a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe).sql +++ b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.PredicateOptimization_Subquery(SqlCe).sql @@ -11,7 +11,7 @@ FROM [WithMultipleDates] [p] OUTER APPLY ( SELECT - MAX([t1].[item]) as [MAX_1] + MAX([t1].[item]) as [Max_1] FROM ( SELECT [p].[Date1] AS [item] @@ -23,7 +23,7 @@ FROM SELECT [p].[Date4] AS [item]) [t1] ) [t2] WHERE - [t2].[MAX_1] > CAST('2023-01-01' AS DateTime) + [t2].[Max_1] > CAST('2023-01-01' AS DateTime) BeforeExecute -- SqlCe @@ -38,7 +38,7 @@ FROM [WithMultipleDates] [p] OUTER APPLY ( SELECT - MAX([t1].[item]) as [MAX_1] + MAX([t1].[item]) as [Max_1] FROM ( SELECT [p].[Date1] AS [item] @@ -50,6 +50,6 @@ FROM SELECT [p].[Date4] AS [item]) [t1] ) [t2] WHERE - [t2].[MAX_1] <= [p].[Date1] OR [t2].[MAX_1] IS NULL OR + [t2].[Max_1] <= [p].[Date1] OR [t2].[Max_1] IS NULL OR [p].[Date1] IS NULL diff --git a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.StringInterpolationTests(SqlCe).sql b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.StringInterpolationTests(SqlCe).sql index c7e1764a20ab..de2a58adc7e9 100644 --- a/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.StringInterpolationTests(SqlCe).sql +++ b/SqlCe/Tests/Linq/WhereTests/Tests.Linq.WhereTests.StringInterpolationTests(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [p] WHERE @@ -16,7 +16,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe).sql b/SqlCe/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe).sql index f034cd02f69e..24771726dc74 100644 --- a/SqlCe/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe).sql +++ b/SqlCe/Tests/Mapping/FluentMappingExpressionMethodTests/Tests.Mapping.FluentMappingExpressionMethodTests.ExpressionMethodOnProperty(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [InstanceClass] [t] diff --git a/SqlCe/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlCe/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index adf560d9b780..526f484c6b59 100644 --- a/SqlCe/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlCe/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlCe,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB] as [LB], [d].[ValInt] as [LI] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE '~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE '~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlCe/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe).sql b/SqlCe/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe).sql index 8a1eed9a4293..e67720478c33 100644 --- a/SqlCe/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe).sql +++ b/SqlCe/Tests/UserTests/GroupBySubqueryTests/Tests.UserTests.GroupBySubqueryTests.Test(SqlCe).sql @@ -21,7 +21,7 @@ BeforeExecute SELECT [g_2].[Field6], [g_2].[Field4], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT DISTINCT diff --git a/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe).sql b/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe).sql index 481d1cfec801..c0e3534be3f9 100644 --- a/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlCe).sql @@ -3,13 +3,13 @@ SELECT [t3].[ParentID], - [t1].[COUNT_1], - [t2].[SUM_1] + [t1].[Count_1], + [t2].[Sum_1] FROM [Parent] [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [od] WHERE @@ -17,7 +17,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([od_1].[ParentID]) as [SUM_1] + SUM([od_1].[ParentID]) as [Sum_1] FROM [Child] [od_1] WHERE @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] @@ -38,7 +38,7 @@ BeforeExecute SELECT [x].[ParentID], [t1].[CountResult], - [t2].[SUM_1] + [t2].[Sum_1] FROM [Parent] [x] OUTER APPLY ( @@ -51,7 +51,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([od_1].[ParentID]) as [SUM_1] + SUM([od_1].[ParentID]) as [Sum_1] FROM [Child] [od_1] WHERE diff --git a/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe).sql b/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe).sql index 56a732909f1d..6389d5808a4e 100644 --- a/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlCe).sql @@ -3,13 +3,13 @@ SELECT [o].[ParentID], - [t1].[COUNT_1], - [t2].[SUM_1] + [t1].[Count_1], + [t2].[Sum_1] FROM [Parent] [o] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE @@ -17,7 +17,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([a_Children_1].[ParentID]) as [SUM_1] + SUM([a_Children_1].[ParentID]) as [Sum_1] FROM [Child] [a_Children_1] WHERE @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [o] @@ -38,7 +38,7 @@ BeforeExecute SELECT [x].[ParentID], [t1].[CountResult], - [t2].[SUM_1] + [t2].[Sum_1] FROM [Parent] [x] OUTER APPLY ( @@ -51,7 +51,7 @@ FROM ) [t1] OUTER APPLY ( SELECT - SUM([a_Children_1].[ParentID]) as [SUM_1] + SUM([a_Children_1].[ParentID]) as [Sum_1] FROM [Child] [a_Children_1] WHERE diff --git a/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.InsertOrReplaceTest(SqlCe).sql b/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.InsertOrReplaceTest(SqlCe).sql index 2f9cb453cb67..2713260450c1 100644 --- a/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.InsertOrReplaceTest(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.InsertOrReplaceTest(SqlCe).sql @@ -47,7 +47,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [InheritanceParent] [t1] @@ -70,7 +70,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [InheritanceParent] [t1] diff --git a/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.TestInsertOrUpdate(SqlCe).sql b/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.TestInsertOrUpdate(SqlCe).sql index 55d67228d7c4..8657253fca3c 100644 --- a/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.TestInsertOrUpdate(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue1238Tests/Tests.UserTests.Issue1238Tests.TestInsertOrUpdate(SqlCe).sql @@ -37,7 +37,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [InheritanceParent] [t1] @@ -56,7 +56,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [InheritanceParent] [t1] diff --git a/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlCe).sql b/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlCe).sql index 641c1e161ef0..1a30ea60ad57 100644 --- a/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlCe).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlCe).sql b/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlCe).sql index 641c1e161ef0..1a30ea60ad57 100644 --- a/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlCe).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlCe/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe).sql b/SqlCe/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe).sql index 02b78d350ec5..e8b59f7ba0fe 100644 --- a/SqlCe/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue192Tests/Tests.UserTests.Issue192Tests.Test(SqlCe).sql @@ -46,7 +46,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TypeConvertTable] [t1] WHERE @@ -56,7 +56,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TypeConvertTable] [t1] WHERE @@ -68,7 +68,7 @@ DECLARE @cond NVarChar(36) -- String SET @cond = 'a948600d-de21-4f74-8ac2-9516b287076e' SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TypeConvertTable] [t1] WHERE diff --git a/SqlCe/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe).sql b/SqlCe/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe).sql index 405754399470..2ac47c44051d 100644 --- a/SqlCe/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlCe).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlCe/Tests/UserTests/Issue564Tests/Tests.UserTests.Issue564Tests.Test(SqlCe).sql b/SqlCe/Tests/UserTests/Issue564Tests/Tests.UserTests.Issue564Tests.Test(SqlCe).sql index 4089cade5f01..d522136c683e 100644 --- a/SqlCe/Tests/UserTests/Issue564Tests/Tests.UserTests.Issue564Tests.Test(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue564Tests/Tests.UserTests.Issue564Tests.Test(SqlCe).sql @@ -38,7 +38,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent564] [t1] diff --git a/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe).sql b/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe).sql index 76896518bdcc..43c272b2afd8 100644 --- a/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test4(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] CROSS JOIN [Parent] [s] diff --git a/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe).sql b/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe).sql index d933a1ff0f06..c698dbb17726 100644 --- a/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue569Tests/Tests.UserTests.Issue569Tests.Test5(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [parent_2] CROSS JOIN [Child] [child_1] diff --git a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCount(SqlCe).sql b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCount(SqlCe).sql index 1d9acbde0d77..3ae244c91052 100644 --- a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCount(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCount(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCountWithSelect(SqlCe).sql b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCountWithSelect(SqlCe).sql index 1d9acbde0d77..3ae244c91052 100644 --- a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCountWithSelect(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestCountWithSelect(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCount(SqlCe).sql b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCount(SqlCe).sql index 1d9acbde0d77..adc8bf502106 100644 --- a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCount(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCount(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM ( SELECT diff --git a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCountWithSelect(SqlCe).sql b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCountWithSelect(SqlCe).sql index 1d9acbde0d77..adc8bf502106 100644 --- a/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCountWithSelect(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue781Tests/Tests.UserTests.Issue781Tests.TestLongCountWithSelect(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [LongCount] FROM ( SELECT diff --git a/SqlCe/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe).sql b/SqlCe/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe).sql index 49dbac30c1b6..785b51c8b916 100644 --- a/SqlCe/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue817Tests/Tests.UserTests.Issue817Tests.TestUnorderedSkip(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe).sql b/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe).sql index 1cf16656bea5..f70291abc486 100644 --- a/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Long(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t1] diff --git a/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe).sql b/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe).sql index 4a8abef39b27..2c339125ef96 100644 --- a/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue820Tests/Tests.UserTests.Issue820Tests.TestOrWithValue_Short(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [LinqDataTypes] [t1] diff --git a/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe).sql b/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe).sql index b8ca3f62f75c..a310f3ee3a19 100644 --- a/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlCe).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe).sql b/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe).sql index 6e2d6ede2004..84b68633947c 100644 --- a/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe).sql +++ b/SqlCe/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlCe).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1] as [Key_2], [p2].[Sum_1] as [Sum_2] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlCe/Tests/xUpdate/BulkCopyTests/Tests.xUpdate.BulkCopyTests.UseParametersTest(SqlCe).sql b/SqlCe/Tests/xUpdate/BulkCopyTests/Tests.xUpdate.BulkCopyTests.UseParametersTest(SqlCe).sql index 889a576a33e6..8f0d2bd9319f 100644 --- a/SqlCe/Tests/xUpdate/BulkCopyTests/Tests.xUpdate.BulkCopyTests.UseParametersTest(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/BulkCopyTests/Tests.xUpdate.BulkCopyTests.UseParametersTest(SqlCe).sql @@ -780,7 +780,7 @@ DECLARE @ParentID_1 Int -- Int32 SET @ParentID_1 = 111149 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [r] WHERE diff --git a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe).sql b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe).sql index d746b384304b..0bb19df11734 100644 --- a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete1(SqlCe).sql @@ -32,7 +32,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -54,7 +54,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe).sql b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe).sql index d746b384304b..0bb19df11734 100644 --- a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete2(SqlCe).sql @@ -32,7 +32,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -54,7 +54,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe).sql b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe).sql index 644abafd79c5..18c32cfc75d9 100644 --- a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete3(SqlCe).sql @@ -38,7 +38,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -67,7 +67,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe).sql b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe).sql index fa698b884f34..378fd5c25dcf 100644 --- a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete4(SqlCe).sql @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [gc] WHERE @@ -72,7 +72,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [GrandChild] [gc] WHERE diff --git a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe).sql b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe).sql index 5ae80f111f6d..69ca59620d7b 100644 --- a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.Delete5(SqlCe).sql @@ -50,7 +50,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE @@ -68,7 +68,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe).sql b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe).sql index e6b7f7b54699..cba81752e607 100644 --- a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableName(SqlCe).sql @@ -28,7 +28,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -58,7 +58,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe).sql b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe).sql index 0eede5967c07..f5f25d1bca07 100644 --- a/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DeleteTests/Tests.xUpdate.DeleteTests.DeleteByTableNameAsync(SqlCe).sql @@ -47,7 +47,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -77,7 +77,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe).sql b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe).sql index 69ba22daecb1..915f85e2546a 100644 --- a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertDynamicColumns(SqlCe).sql @@ -18,7 +18,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe).sql b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe).sql index 58a6c765251c..b93f4761bace 100644 --- a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.InsertViaSqlProperty(SqlCe).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe).sql b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe).sql index 72a39847f740..6b55ea3319e2 100644 --- a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateDynamicColumn(SqlCe).sql @@ -18,7 +18,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [c_1] WHERE @@ -38,7 +38,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe).sql b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe).sql index f7907a31c080..e2c5d3eabc66 100644 --- a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlProperty(SqlCe).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe).sql b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe).sql index 866351fb4081..23aec2606cc4 100644 --- a/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/DynamicColumnsTests/Tests.xUpdate.DynamicColumnsTests.UpdateViaSqlPropertyValue(SqlCe).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe).sql index feb105eb4eb9..1ca7666980bb 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.AsValueInsertableTest(SqlCe).sql @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [TestInsertOrReplaceTable] [x] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe).sql index f48be99ae502..811bb4fd6315 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert1(SqlCe).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe).sql index 9e5109752eac..860a6f80144d 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert11(SqlCe).sql @@ -2,7 +2,7 @@ -- SqlCe SELECT - MAX([t1].[PersonID]) as [MAX_1] + MAX([t1].[PersonID]) as [Max_1] FROM [Person] [t1] diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe).sql index e1cdb12e8f8e..d5e02560bcd4 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert15(SqlCe).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe).sql index 60692dab7dff..a9fbe5368803 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert16(SqlCe).sql @@ -30,7 +30,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe).sql index f48be99ae502..811bb4fd6315 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2(SqlCe).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe).sql index 977f4f57ddd9..ec1755e6e251 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert2Async(SqlCe).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe).sql index 7ae48e9d2496..902207b6912d 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe).sql index 7ae48e9d2496..902207b6912d 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert31(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe).sql index f53a22c0dd10..29665483a52f 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert3Async(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe).sql index 7ae48e9d2496..902207b6912d 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe).sql index f53a22c0dd10..29665483a52f 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert4Async(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe).sql index c095512bb2f5..9a4b3f827655 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert5(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe).sql index 0e460979e7b9..c410018037b3 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert6(SqlCe).sql @@ -26,7 +26,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe).sql index c095c4a3a8ed..ad940cf436b8 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert7(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe).sql index bd367f9c4228..01aa872e9e3e 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert8(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe).sql index 0eeb37e53f45..9e0be6841faf 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.Insert9(SqlCe).sql @@ -56,7 +56,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe).sql index 6d634a80f9f2..73b2d787db9b 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableName(SqlCe).sql @@ -109,7 +109,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -117,7 +117,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe).sql index 65f8e38c494e..a155cce39786 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertByTableNameAsync(SqlCe).sql @@ -104,7 +104,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] @@ -112,7 +112,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe).sql index 8e7fd8a756ca..2e85fdaf8a8d 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum1(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @Value1 Int -- Int32 SET @Value1 = 2 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe).sql index d0ef3261a298..cb8e5591dcc5 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum2(SqlCe).sql @@ -30,7 +30,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe).sql index 197739962034..585496124cba 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertEnum3(SqlCe).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [t1] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe).sql index b9a6a7ccdd81..942039c3b903 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertNull(SqlCe).sql @@ -20,7 +20,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe).sql index 9807ae618b4a..6ecd89c42776 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableName(SqlCe).sql @@ -82,7 +82,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] @@ -118,7 +118,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe).sql index 6779479aebc9..23308e6c9791 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertOrReplaceByTableNameAsync(SqlCe).sql @@ -82,7 +82,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] @@ -118,7 +118,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPatient] [t1] diff --git a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe).sql b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe).sql index b89fe745c84e..8c8c693fa28c 100644 --- a/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/InsertTests/Tests.xUpdate.InsertTests.InsertUnion1(SqlCe).sql @@ -36,7 +36,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe).sql index 7c2fcc8154ae..6a8eae6a9122 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableDuplicate(SqlCe).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -63,7 +63,7 @@ DECLARE @p Int -- Int32 SET @p = 1003 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe).sql index e8bd5965cc95..e9edc5cb2c6d 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.AsUpdatableTest(SqlCe).sql @@ -28,7 +28,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -63,7 +63,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe).sql index da9cfec2d289..ed9a47df1be9 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1(SqlCe).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe).sql index f6ae9d3b5a33..f7cb2bd92201 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update14(SqlCe).sql @@ -42,7 +42,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Person] [t1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe).sql index 0bc65fde7fcb..9fc84df66aa0 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update1Async(SqlCe).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe).sql index da9cfec2d289..ed9a47df1be9 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2(SqlCe).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe).sql index 0bc65fde7fcb..9fc84df66aa0 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update2Async(SqlCe).sql @@ -22,7 +22,7 @@ DECLARE @ParentID Int -- Int32 SET @ParentID = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe).sql index f7907a31c080..e2c5d3eabc66 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update3(SqlCe).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe).sql index f7907a31c080..e2c5d3eabc66 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4(SqlCe).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe).sql index ba85c1adb0c8..a87e196e3ebf 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update4Async(SqlCe).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -55,7 +55,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe).sql index cf7f44cb8d23..027d2014bc02 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update5(SqlCe).sql @@ -20,7 +20,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE @@ -57,7 +57,7 @@ DECLARE @p Int -- Int32 SET @p = 1002 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe).sql index b16e1e141042..cfa0b39b817b 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update6(SqlCe).sql @@ -22,7 +22,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -46,7 +46,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe).sql index eaf668b8a579..a32e72331493 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.Update7(SqlCe).sql @@ -22,7 +22,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -48,7 +48,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE @@ -74,7 +74,7 @@ DECLARE @id Int -- Int32 SET @id = 1001 SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p] WHERE diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe).sql index 74d544c56553..6671ac42f53b 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableName(SqlCe).sql @@ -47,7 +47,7 @@ BeforeExecute -- SqlCe SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe).sql index c27c7168534e..2d5d169d8905 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateByTableNameAsync(SqlCe).sql @@ -47,7 +47,7 @@ BeforeExecute -- SqlCe (asynchronously) SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [xxPerson] [t1] diff --git a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe).sql b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe).sql index 16a6d906352a..cd52adc13d66 100644 --- a/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe).sql +++ b/SqlCe/Tests/xUpdate/UpdateTests/Tests.xUpdate.UpdateTests.UpdateIssue319Regression(SqlCe).sql @@ -47,13 +47,13 @@ WHERE [Parent] [p], ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Parent] [p_1] WHERE [p_1].[ParentID] = @id ) [t1] WHERE - [p].[ParentID] = @id AND [t1].[COUNT_1] > 0 AND [Parent].[ParentID] = [p].[ParentID] + [p].[ParentID] = @id AND [t1].[Count_1] > 0 AND [Parent].[ParentID] = [p].[ParentID] ) diff --git a/SqlServer.2005.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.LinqService).sql new file mode 100644 index 000000000000..d7921eef8843 --- /dev/null +++ b/SqlServer.2005.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2005 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2005.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.LinqService).sql new file mode 100644 index 000000000000..6bd3a60b84cb --- /dev/null +++ b/SqlServer.2005.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2005 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2005.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.LinqService).sql index b36b0d9c5806..41cfd2e7951c 100644 --- a/SqlServer.2005.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2005.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.LinqService).sql index a74be2dea7ae..2b5190378a49 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2005.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.LinqService,False).sql b/SqlServer.2005.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.LinqService,False).sql index 5cfe152d7822..26bd3e0027ec 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.LinqService,False).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2005 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2005 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2005.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.LinqService).sql index 3558cab7ba92..a7d652777da2 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.LinqService).sql index f870e8420988..a619161395f9 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.LinqService).sql index d7de370ac400..3aab4cf2615a 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.LinqService).sql index b9343336bf89..a3de4e197391 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.LinqService).sql index 04465b035948..67eddf21df44 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2005 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.LinqService).sql index 04465b035948..67eddf21df44 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2005 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.LinqService).sql index e76e707b9646..a866d32fc684 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.LinqService).sql index d2e871b30959..15771ac5fd25 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.LinqService).sql index edb5d04526c6..563f3188f25c 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.LinqService).sql index a21667ed9195..170ddbbde929 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.LinqService).sql index 7772b2671394..450f22de9aaa 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.LinqService).sql index 7772b2671394..450f22de9aaa 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.LinqService).sql index c7becfbfe184..6ae6480825c8 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.LinqService).sql index c7becfbfe184..6ae6480825c8 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.LinqService).sql index 13309fd2c72b..a436c9aed94c 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2005.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.LinqService).sql index 6639390c16f5..b417bc65fcd7 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.LinqService).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.LinqService).sql index 4410ca057b91..73f17a572d8e 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.LinqService).sql index e2366d8fc217..5a5845fb17ff 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.LinqService).sql index df093665bc6c..b61703ea0c9e 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.LinqService).sql index 185b2925371f..98b7b6c2d501 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2005 (asynchronously) SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.LinqService).sql index 76259bc3e931..fe8258969048 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 (asynchronously) SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.LinqService).sql index 9f9afccba775..d6d803b2ebe7 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.LinqService).sql index 46811376d6d7..97e068415ec4 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.LinqService).sql index ed55ddb10c8e..4b041fbfa2f8 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.LinqService).sql index 5082f40ac97f..d9172807b898 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.LinqService).sql index a0594a13017a..796e46750fce 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.LinqService).sql @@ -2,93 +2,41 @@ -- SqlServer.2005 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.LinqService).sql index e3bf049215d3..1f6056f29fbf 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.LinqService).sql index 158f649d7922..7906307f6d32 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.LinqService).sql @@ -2,23 +2,23 @@ -- SqlServer.2005 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.LinqService).sql index 1bcedf6c3400..c11a2ebf5943 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.LinqService).sql index f24d6512e935..eabeb8e433b0 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.LinqService).sql index e61e2cf6210f..afaf0a22c76f 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.LinqService).sql index 313da14ecac4..12f9ac2af37f 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.LinqService).sql index 6a166d008b2d..6d03c8bc090c 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.LinqService).sql index 18d7118607eb..6497ba1344d3 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,1).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,1).sql index f5bd9c426a30..aa7c060a68f5 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,2).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,2).sql index f5bd9c426a30..aa7c060a68f5 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,1).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,1).sql index 6a166d008b2d..6d03c8bc090c 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,1).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,2).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,2).sql index 6a166d008b2d..6d03c8bc090c 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,2).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.LinqService).sql index cf06bfd5ef79..c89affe62c0b 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.LinqService).sql index 6a166d008b2d..6d03c8bc090c 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.LinqService).sql index 18d7118607eb..6497ba1344d3 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.LinqService).sql index 4f5feea24c2b..b6a8ddc0c2ec 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.LinqService).sql index 83de286cace6..b151f1d4ab85 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.LinqService).sql index 313da14ecac4..12f9ac2af37f 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.LinqService).sql index cf06bfd5ef79..c89affe62c0b 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.LinqService).sql index b57e5799e8e0..57e43a504931 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.LinqService).sql index 9b7a07ada640..f3c5a8ab751d 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.LinqService).sql index 9b7a07ada640..f3c5a8ab751d 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.LinqService).sql index da03808789d1..11ebb8979252 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.LinqService).sql index da03808789d1..11ebb8979252 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.LinqService).sql index 32b6b6ed0504..1ce37a27cfb7 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2005.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.LinqService).sql index 9355fdc34be0..5de876b45731 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.LinqService).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2005.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.LinqService).sql new file mode 100644 index 000000000000..fc0c9cd73181 --- /dev/null +++ b/SqlServer.2005.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2005 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2005 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2005 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2005 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.LinqService).sql index 337fe32b7f04..79fa8b3ee848 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.LinqService).sql @@ -7,30 +7,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute -- SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.LinqService).sql index 43394d4e9659..6d8fc0f34fa1 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.LinqService).sql @@ -7,30 +7,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute -- SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.LinqService).sql index 79f4919d5cb4..267555156280 100644 --- a/SqlServer.2005.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2005.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2005.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index de00eab9178e..adee1cf8810d 100644 --- a/SqlServer.2005.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2005.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.LinqService).sql index 4f89234da119..afe0d7874d4f 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.LinqService).sql index 7460071a80eb..3f310cb37178 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.LinqService).sql index e1031dadad47..cd1b8591438f 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.LinqService).sql index 9c0907d1269f..2b94bd4c7ecb 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.LinqService).sql index ba55d34f7989..1c1cf39940b8 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.LinqService).sql index 4f62a40a50d1..c404d290e927 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.LinqService).sql index 559a40a6624e..116bdd1d2918 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.LinqService).sql index b99daf6a77ea..0f6d0f3b3764 100644 --- a/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.LinqService).sql index 730d7c76126a..f6fb1d67bba3 100644 --- a/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.LinqService).sql b/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.LinqService).sql index 730d7c76126a..f6fb1d67bba3 100644 --- a/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.LinqService).sql +++ b/SqlServer.2005.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2005.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.MS.LinqService).sql new file mode 100644 index 000000000000..0ce1f581cf2c --- /dev/null +++ b/SqlServer.2005.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2005.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.MS.LinqService).sql new file mode 100644 index 000000000000..c747f76383f4 --- /dev/null +++ b/SqlServer.2005.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2005.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS.LinqService).sql index 33e45c19983a..4dc0f56ff0be 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS.LinqService).sql index 5545bbe5f1a4..0a459a5a8be0 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS.LinqService,False).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS.LinqService,False).sql index 7571ce060ce2..327c74077a81 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS.LinqService,False).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS.LinqService).sql index a2e511b137ca..24442e0451d5 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS.LinqService).sql index ab348f557460..fb8ef648f0ae 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS.LinqService).sql index c32fda7ddb71..c9b72837ac67 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS.LinqService).sql index e5c0a1f2d8e7..b3fa31e9bd06 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS.LinqService).sql index 0d1c6ce49db4..7dc1966671a0 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS.LinqService).sql index 0d1c6ce49db4..7dc1966671a0 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS.LinqService).sql index b6ffcb66ca69..c6f43f4586be 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS.LinqService).sql index dff01df40a81..cad388f98379 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS.LinqService).sql index c1a768b11ae6..aec917deff53 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS.LinqService).sql index 25974708f7c1..8d2955963125 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS.LinqService).sql index c727c917edb8..243ec41e5bb9 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS.LinqService).sql index c727c917edb8..243ec41e5bb9 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS.LinqService).sql index 67ab0a8b7e17..5b682ff5aba2 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS.LinqService).sql index 67ab0a8b7e17..5b682ff5aba2 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS.LinqService).sql index d3c433c7d227..2589f4d18d81 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS.LinqService).sql index 84e8e8b2c88d..4fe10e494f20 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS.LinqService).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS.LinqService).sql index 05b7d924d888..7e7eeed5662b 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS.LinqService).sql index 7c459232502c..c333b6da308d 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS.LinqService).sql index d4b2fab1f3f6..2364086e46af 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS.LinqService).sql index d3517f359bd7..cb30d0709e84 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS.LinqService).sql index 402cf1f87ea5..77ecb51b2068 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS.LinqService).sql index 37552b5644ee..afd0244b3bb4 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS.LinqService).sql index 40d7040f266f..f85a447e6b33 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS.LinqService).sql index c59d3de741ee..d89298e844ae 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS.LinqService).sql index 3ae32145c0e5..b297e00bf197 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS.LinqService).sql index 8881aeac55c0..387224f60a6f 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS.LinqService).sql @@ -2,93 +2,41 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS.LinqService).sql index 482ea1718cbb..1aa0f6624ea0 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS.LinqService).sql index ec857fd85bad..bbeec6cf8902 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS.LinqService).sql @@ -2,23 +2,23 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS.LinqService).sql index 11e987e1d2e7..44be7c150c89 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS.LinqService).sql index d10b0cc7fdd2..e866f582ac37 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS.LinqService).sql index 88f1951a37a4..35e4aec6a968 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS.LinqService).sql index 96229c9770c2..446a57731255 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS.LinqService).sql index 17e6a851c41f..84aadaa21c60 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS.LinqService).sql index de652dfeb285..fe690e999672 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,1).sql index c1555c661617..b07f9329f996 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,2).sql index c1555c661617..b07f9329f996 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,1).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,1).sql index 17e6a851c41f..84aadaa21c60 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,2).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,2).sql index 17e6a851c41f..84aadaa21c60 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS.LinqService).sql index 0556d6ed130d..15105d86ca4f 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS.LinqService).sql index 17e6a851c41f..84aadaa21c60 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS.LinqService).sql index de652dfeb285..fe690e999672 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS.LinqService).sql index fa47ec534a4b..1af535ccbadc 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS.LinqService).sql index ba6c1d5a7b80..13b8b66261ac 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS.LinqService).sql index 96229c9770c2..446a57731255 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS.LinqService).sql index 0556d6ed130d..15105d86ca4f 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS.LinqService).sql index 2061bf47a0cb..927a264a47ff 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS.LinqService).sql index 93829cf7d6ea..8b29749f0cd4 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS.LinqService).sql index 93829cf7d6ea..8b29749f0cd4 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS.LinqService).sql index 5accc28214b0..6e3ff31d8ab7 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS.LinqService).sql index 5accc28214b0..6e3ff31d8ab7 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS.LinqService).sql index 22009e178007..ca061625a128 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS.LinqService).sql index 068e92247f82..44dfa04d60ff 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS.LinqService).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.MS.LinqService).sql new file mode 100644 index 000000000000..fe247434ff8d --- /dev/null +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS.LinqService).sql index c0eed32c214f..9c638bde1979 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS.LinqService).sql @@ -7,30 +7,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS.LinqService).sql index 70afcd6ac3a8..79af86a692f9 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS.LinqService).sql @@ -7,30 +7,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS.LinqService).sql index 809dbf7ec073..1a0d5d6755a8 100644 --- a/SqlServer.2005.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2005.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2005.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index c4961d5ba4df..bc5043301578 100644 --- a/SqlServer.2005.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2005.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 (asynchronously) diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS.LinqService).sql index c3c9df6999f6..dc6fb7865ff8 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS.LinqService).sql index 907a6c3a257e..0b0f45cd6cd7 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS.LinqService).sql index f269fa63e438..68ee9df77253 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS.LinqService).sql index b5cde9013eb0..3e77b34f2d7b 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS.LinqService).sql index a159cb010891..7db36a0298df 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS.LinqService).sql index 1a540d52eab4..8e41c706dc0f 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS.LinqService).sql index 2bb941d72a43..c3b578d9b8cd 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS.LinqService).sql index ac2eb71cc975..02432b0d4bfa 100644 --- a/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS.LinqService).sql index 41ef0824f1fb..401d6aa3a6a4 100644 --- a/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS.LinqService).sql b/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS.LinqService).sql index 41ef0824f1fb..401d6aa3a6a4 100644 --- a/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS.LinqService).sql +++ b/SqlServer.2005.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2005.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.MS).sql new file mode 100644 index 000000000000..7f85cf3ff559 --- /dev/null +++ b/SqlServer.2005.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2005.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.MS).sql new file mode 100644 index 000000000000..95d4b3f05cd8 --- /dev/null +++ b/SqlServer.2005.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2005.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS).sql index a55225d0e431..8ebfd209bf35 100644 --- a/SqlServer.2005.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2005.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS).sql index 2ae28c2c06b8..353feb6a42f2 100644 --- a/SqlServer.2005.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2005.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS,False).sql b/SqlServer.2005.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS,False).sql index 642ae8b13a58..b0e770e57f1c 100644 --- a/SqlServer.2005.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS,False).sql +++ b/SqlServer.2005.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2005.MS SqlServer.2005 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2005.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS).sql index cc7ff7d3838c..6d38c839478d 100644 --- a/SqlServer.2005.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS).sql index 820577b8cc86..faa330b06c8f 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS).sql index bed1ffb1b86f..4bd8e64e05a7 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS).sql index e525333e3739..99b914b05013 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS).sql index f1928eb35f40..5f580d20670f 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005.MS).sql @@ -2,22 +2,22 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS).sql index f1928eb35f40..5f580d20670f 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005.MS).sql @@ -2,22 +2,22 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS).sql index 1ebaa0d1aa82..ce7b6dfda67e 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005.MS).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS).sql index b7c4f10f626a..4f561b6362f6 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS).sql index 32756d08d1a9..9de6c6943564 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS).sql index 3c6ee71ad07b..9975bcada3ca 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS).sql index 59719ab1836a..c306ec86fc94 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005.MS).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS).sql index 59719ab1836a..c306ec86fc94 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005.MS).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS).sql index d29a33ff8fa5..edf51a5053f5 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS).sql index 67ab0a8b7e17..5b682ff5aba2 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS).sql index b6e5292e68a1..d6518a14e9be 100644 --- a/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2005.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS).sql index ec034659d949..f37d7f8661bb 100644 --- a/SqlServer.2005.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005.MS).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2005.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2005.MS).sql new file mode 100644 index 000000000000..d4839f16f37c --- /dev/null +++ b/SqlServer.2005.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2005.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2005.MS SqlServer.2005 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS).sql index 0d7cfd0c6793..7242ea0063e0 100644 --- a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS).sql index fc57464542b7..d40b96c1cad7 100644 --- a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS).sql index d592c65115a0..11542a17a2ce 100644 --- a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS).sql index f928c812935b..9abc2bcfdb2e 100644 --- a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS).sql index eff23a585052..7ff3c7311cbb 100644 --- a/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005.MS).sql index 234d4ccbc44d..d0891a2492e2 100644 --- a/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM ( - SELECT [a_Color].[Name] AS [ColorName], [t2].[COUNT_1] AS [Count], 0 AS [index], [a_Style].[Name] AS [StyleName], CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + SELECT [a_Color].[Name] AS [ColorName], [t2].[Count_1] AS [Count], [a_Style].[Name] AS [StyleName], CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END AS [Conditional], 1 AS [field1], 2 AS [field2], 3 AS [field3] UNION ALL - SELECT NULL, 0, 1, [a_Style].[Name], NULL, 4, 5, 6) [it] + SELECT NULL, 0, [a_Style].[Name], NULL, 4, 5, 6) [it] ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY ( - SELECT [a_Color].[Name] AS [ColorName], [t2].[COUNT_1] AS [Count], CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + SELECT [a_Color].[Name] AS [ColorName], [t2].[Count_1] AS [Count], CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END AS [Conditional] UNION ALL diff --git a/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005.MS).sql index b2d115e75f5e..e82fa10709e6 100644 --- a/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,21 +34,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM ( - SELECT [t1].[ColorName] AS [ColorName], [t1].[Count_1] AS [Count], 0 AS [index], [t1].[StyleName] AS [StyleName], CASE + SELECT [t1].[ColorName] AS [ColorName], [t1].[Count_1] AS [Count], [t1].[StyleName] AS [StyleName], CASE WHEN [t1].[ColorName] = N'Red' THEN [t1].[Count_1] ELSE 0 END AS [Conditional], 1 AS [field1], 2 AS [field2], 3 AS [field3] UNION ALL - SELECT NULL, 0, 1, [t1].[StyleName], NULL, 4, 5, 6) [it] + SELECT NULL, 0, [t1].[StyleName], NULL, 4, 5, 6) [it] ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005.MS).sql index 6738c73f0b91..850d54738a63 100644 --- a/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005.MS).sql @@ -20,7 +20,7 @@ FROM ( SELECT [a_Color].[Name] AS [ColorName], [a_Style].[Name] AS [StyleName], ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) AS [Count] diff --git a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS).sql index 6947b91911bf..465cae83a616 100644 --- a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS).sql index d21acfb74c5d..cf2ff66a6795 100644 --- a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS).sql index 94dce04dde90..5e5afede508f 100644 --- a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS).sql index d848cf6ede0d..08ea78ba9f7d 100644 --- a/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS).sql index 73b31a65f81b..7f1c08983d7c 100644 --- a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005.MS).sql @@ -2,93 +2,41 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2005.MS SqlServer.2005 diff --git a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS).sql index ec7fed536b85..b30e12fa5c0e 100644 --- a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS).sql index 3d32ca0817f2..7d91193b4009 100644 --- a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005.MS).sql @@ -2,23 +2,23 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS).sql index f71993737687..3250adaaf7b4 100644 --- a/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS).sql index fcd3faf85460..e79a2b7c6390 100644 --- a/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS).sql index 0a5a1b1679a4..1fc431d89de4 100644 --- a/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS).sql index a32ce2ba2248..0ee5ec9c7ed3 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS).sql index a84b491545ba..b1d80ccc7d01 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS).sql index 1610f21f3d29..92ec1f1b341a 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,1).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,1).sql index 8a1c22d9eb10..0f97e48222a7 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,1).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,2).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,2).sql index 8a1c22d9eb10..0f97e48222a7 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,2).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,1).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,1).sql index a84b491545ba..b1d80ccc7d01 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,1).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,2).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,2).sql index a84b491545ba..b1d80ccc7d01 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,2).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005.MS,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS).sql index edc9ea0d0687..117d3b4da3bb 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS).sql index a84b491545ba..b1d80ccc7d01 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS).sql index 1610f21f3d29..92ec1f1b341a 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS).sql index 697ef1439a28..f16048f44b15 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS).sql index 943f54778233..f85c241d5dce 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS).sql index a32ce2ba2248..0ee5ec9c7ed3 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS).sql index edc9ea0d0687..117d3b4da3bb 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS).sql index 9c3e7f018072..3b895fd7d494 100644 --- a/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS).sql index bc755adaab0b..1b7f7e511272 100644 --- a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS).sql index bc755adaab0b..1b7f7e511272 100644 --- a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS).sql index 6b7b9d284fec..2ac17acadf6e 100644 --- a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS).sql index 6b7b9d284fec..2ac17acadf6e 100644 --- a/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005.MS SqlServer.2005 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS).sql index e03ac0d08ad7..e7d38e33d10c 100644 --- a/SqlServer.2005.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2005.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS).sql index 31d908aa0e42..a4ebe6c669b2 100644 --- a/SqlServer.2005.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005.MS).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2005.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.MS).sql index ac0ff3dd6eda..c3e488a68c75 100644 --- a/SqlServer.2005.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2005.MS SqlServer.2005 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2005.MS SqlServer.2005 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2005.MS SqlServer.2005 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS).sql index 1a323cf68373..90f0f181e50c 100644 --- a/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005.MS).sql @@ -9,30 +9,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS).sql index 2ea8f0bb2334..8f5d935fdcb6 100644 --- a/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005.MS).sql @@ -9,30 +9,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2005.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS).sql index 06ac46f32b1b..2a470344f878 100644 --- a/SqlServer.2005.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2005.MS SqlServer.2005 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2005.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2005.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 83b248731510..802037c853b6 100644 --- a/SqlServer.2005.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2005.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS).sql index 16713361c338..0509fd47f10e 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS).sql index 934a986828f5..529fc335fcc8 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS).sql index c8f63a2eb13f..e02fd5dc4813 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005.MS).sql index c8f63a2eb13f..e02fd5dc4813 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS).sql index d497bd404b5d..cf5cefaaa483 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005.MS).sql index f388ce87808b..5149a923cb4e 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005.MS).sql index f388ce87808b..5149a923cb4e 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005.MS).sql index cc5275cdf62d..b4f716012e06 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005.MS).sql @@ -3,7 +3,7 @@ SELECT CASE - WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000) + WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647) THEN 1 ELSE 0 END diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS).sql index c9998288a8c2..780abe1b4089 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS).sql index d78e00621f5c..55f51f7ec530 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS).sql index 51d7ce61ac04..38eeab594ff9 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS).sql index 9f0f77966c17..fa2411dac4eb 100644 --- a/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS).sql index 264530989318..11b9c04ec74c 100644 --- a/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS).sql b/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS).sql index 264530989318..11b9c04ec74c 100644 --- a/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS).sql +++ b/SqlServer.2005.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2005/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005).sql b/SqlServer.2005/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005).sql new file mode 100644 index 000000000000..374b90306a56 --- /dev/null +++ b/SqlServer.2005/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2005).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2005 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2005/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005).sql b/SqlServer.2005/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005).sql new file mode 100644 index 000000000000..47473e7c2c43 --- /dev/null +++ b/SqlServer.2005/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2005).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2005 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2005/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005).sql b/SqlServer.2005/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005).sql index 8857067a3879..e63328db09f6 100644 --- a/SqlServer.2005/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2005).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2005/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005).sql index dfccd2584382..1a25f06677e8 100644 --- a/SqlServer.2005/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2005).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2005/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005,False).sql b/SqlServer.2005/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005,False).sql index bfbb6ddc278a..c0c02252f857 100644 --- a/SqlServer.2005/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005,False).sql +++ b/SqlServer.2005/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2005,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2005 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2005 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2005/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005).sql index fa4ab31d99fc..7760412eadc2 100644 --- a/SqlServer.2005/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2005).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005).sql index ba22f749ae4f..6c2f1e841ff8 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2005).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005).sql index c15b88840324..b76a5d98b069 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2005).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005).sql index ee2ee4f43afe..1000e17092c6 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2005).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005).sql index e72a4f8cb689..3d332343a790 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2005).sql @@ -2,22 +2,22 @@ -- SqlServer.2005 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005).sql index e72a4f8cb689..3d332343a790 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2005).sql @@ -2,22 +2,22 @@ -- SqlServer.2005 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005).sql index 6701a829e1f2..5266bb629da1 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2005).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005).sql index 977292e40210..4ee233262894 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2005).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005).sql index b4463f2abd28..f24b4153ff2a 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2005).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005).sql index 980e24710f76..09b9fee3b8a3 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2005).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005).sql index 98d5ac5e981f..12e7261947f9 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2005).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005).sql index 98d5ac5e981f..12e7261947f9 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2005).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005).sql index 269a9bb14e6d..794e8e3900d2 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2005).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005).sql index c7becfbfe184..6ae6480825c8 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2005).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005).sql index 51515a541e70..1b7171efe340 100644 --- a/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2005).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2005/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005).sql index e5374a3d8924..37f1b35fc829 100644 --- a/SqlServer.2005/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2005).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2005/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2005).sql new file mode 100644 index 000000000000..68546b8fa4b2 --- /dev/null +++ b/SqlServer.2005/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2005).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2005 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2005 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005).sql index 1ddff9cd857d..5f45a450b51d 100644 --- a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2005).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005).sql index 5ef570b96055..2b2c3e543dfd 100644 --- a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2005).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005).sql index e3b28437bcbf..eb80be6cbd44 100644 --- a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2005).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005).sql index 173e22f9b0e5..f33f2989d6f2 100644 --- a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2005).sql @@ -2,13 +2,13 @@ -- SqlServer.2005 SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005).sql index d9699f8ceaf6..ced820ae2a1c 100644 --- a/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2005).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005).sql index 2b20673f640e..452a146861f3 100644 --- a/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2005).sql @@ -2,7 +2,6 @@ -- SqlServer.2005 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM ( - SELECT [a_Color].[Name] AS [ColorName], [t2].[COUNT_1] AS [Count], 0 AS [index], [a_Style].[Name] AS [StyleName], CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + SELECT [a_Color].[Name] AS [ColorName], [t2].[Count_1] AS [Count], [a_Style].[Name] AS [StyleName], CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END AS [Conditional], 1 AS [field1], 2 AS [field2], 3 AS [field3] UNION ALL - SELECT NULL, 0, 1, [a_Style].[Name], NULL, 4, 5, 6) [it] + SELECT NULL, 0, [a_Style].[Name], NULL, 4, 5, 6) [it] ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY ( - SELECT [a_Color].[Name] AS [ColorName], [t2].[COUNT_1] AS [Count], CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + SELECT [a_Color].[Name] AS [ColorName], [t2].[Count_1] AS [Count], CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END AS [Conditional] UNION ALL diff --git a/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005).sql index 3ac3842ad90a..dcecf679bdec 100644 --- a/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2005).sql @@ -2,7 +2,6 @@ -- SqlServer.2005 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,21 +34,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM ( - SELECT [t1].[ColorName] AS [ColorName], [t1].[Count_1] AS [Count], 0 AS [index], [t1].[StyleName] AS [StyleName], CASE + SELECT [t1].[ColorName] AS [ColorName], [t1].[Count_1] AS [Count], [t1].[StyleName] AS [StyleName], CASE WHEN [t1].[ColorName] = N'Red' THEN [t1].[Count_1] ELSE 0 END AS [Conditional], 1 AS [field1], 2 AS [field2], 3 AS [field3] UNION ALL - SELECT NULL, 0, 1, [t1].[StyleName], NULL, 4, 5, 6) [it] + SELECT NULL, 0, [t1].[StyleName], NULL, 4, 5, 6) [it] ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005).sql index d4f298f4de20..fd5a92e1b757 100644 --- a/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2005).sql @@ -20,7 +20,7 @@ FROM ( SELECT [a_Color].[Name] AS [ColorName], [a_Style].[Name] AS [StyleName], ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) AS [Count] diff --git a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005).sql index 26e72d969205..0ed898150f9e 100644 --- a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2005).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005).sql index 7c261915dead..8fe88c4b48ea 100644 --- a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2005).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005).sql index 47ca90a8b8cd..c3d77f7a8c58 100644 --- a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2005).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005).sql index 374814a447f8..0887475e3f18 100644 --- a/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2005).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005).sql index 6dc43cb74339..fd38e5517997 100644 --- a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2005).sql @@ -2,93 +2,41 @@ -- SqlServer.2005 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2005 diff --git a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005).sql index 3a15115d4157..3c358826a0b5 100644 --- a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2005).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005).sql index 639f2699d646..de26b34e5231 100644 --- a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2005).sql @@ -2,23 +2,23 @@ -- SqlServer.2005 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005).sql index 97c823080d0e..1b48e6823f99 100644 --- a/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2005).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005).sql index 318a998e9561..6e013d2b586f 100644 --- a/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2005).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005).sql index 964ef2e84bf6..2b2bc5c6ec32 100644 --- a/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2005).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005).sql index 6976fe7ee6a2..38f3d8411a16 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2005).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005).sql index fe08f718763f..b3e7e1c5e722 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2005).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005).sql index cb30d75642a3..cc146aac8f48 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2005).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,1).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,1).sql index 61885eec94c1..a6037cce70f5 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,1).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,2).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,2).sql index 61885eec94c1..a6037cce70f5 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,2).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,1).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,1).sql index fe08f718763f..b3e7e1c5e722 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,1).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,2).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,2).sql index fe08f718763f..b3e7e1c5e722 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,2).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2005,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005).sql index 56363de27efb..da8b07b848bb 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2005).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005).sql index fe08f718763f..b3e7e1c5e722 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2005).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005).sql index cb30d75642a3..cc146aac8f48 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2005).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005).sql index 5c1255a8e103..71bd80e443d0 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2005).sql @@ -2,9 +2,14 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005).sql index 15a871fd7e4a..3e144d35255a 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2005).sql @@ -2,9 +2,14 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005).sql index 6976fe7ee6a2..38f3d8411a16 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2005).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005).sql index 56363de27efb..da8b07b848bb 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2005).sql @@ -2,13 +2,18 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005).sql index b2a09fc5345a..0540916c2ac1 100644 --- a/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2005).sql @@ -2,9 +2,14 @@ -- SqlServer.2005 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005).sql index 6eb60934a999..cf850f172ee3 100644 --- a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2005).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005).sql index 6eb60934a999..cf850f172ee3 100644 --- a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2005).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2005 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2005 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2005 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2005 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005).sql index 9848e7ad1649..35790da518ee 100644 --- a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2005).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005).sql index 9848e7ad1649..35790da518ee 100644 --- a/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2005).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2005 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2005 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2005 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2005 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2005 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2005 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2005/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005).sql index 9fddda9753e1..a0db5473d49d 100644 --- a/SqlServer.2005/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2005).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2005/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005).sql index 3246fec929ab..56fc146355d3 100644 --- a/SqlServer.2005/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2005).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2005/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005).sql index 97020eb60fd2..cfc1297150e7 100644 --- a/SqlServer.2005/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2005).sql @@ -2,7 +2,7 @@ -- SqlServer.2005 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2005 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2005 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2005 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005).sql index fdc47fc8c85f..be2d230377ce 100644 --- a/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2005).sql @@ -9,30 +9,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005).sql index 558dc7233e36..4402d4519109 100644 --- a/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2005).sql @@ -9,30 +9,25 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - ( - SELECT N'A' AS [item] - UNION ALL - SELECT N'B') [t1] - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + ( + SELECT N'A' AS [item] + UNION ALL + SELECT N'B') [t1] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2005/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005).sql b/SqlServer.2005/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005).sql index ded4f13aaae2..38c2fdff7654 100644 --- a/SqlServer.2005/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2005).sql @@ -2,12 +2,12 @@ -- SqlServer.2005 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2005/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2005/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 7fdd6b7fbf2b..f1d4ea5d3358 100644 --- a/SqlServer.2005/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2005/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2005,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005).sql index 9d60001f9edd..673eca4036f7 100644 --- a/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2005).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005).sql index 94d22c7e252d..fc57961e59ff 100644 --- a/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2005).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005).sql index 18cc1b9bf9b2..36c83361a58e 100644 --- a/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2005).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005).sql index 18cc1b9bf9b2..36c83361a58e 100644 --- a/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2005).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005).sql index d81780caa9b2..9fa4de272cf1 100644 --- a/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2005).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005).sql index f388ce87808b..5149a923cb4e 100644 --- a/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2005).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005).sql index f388ce87808b..5149a923cb4e 100644 --- a/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2005).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2005/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005).sql index aa3afb7afa56..837b6ba3682d 100644 --- a/SqlServer.2005/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2005).sql @@ -3,7 +3,7 @@ SELECT CASE - WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000) + WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647) THEN 1 ELSE 0 END diff --git a/SqlServer.2005/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005).sql index a36f9675aff3..2fd4a0ef75f8 100644 --- a/SqlServer.2005/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2005).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2005/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005).sql index 59cc3fcc5cbd..74dfca6ee94e 100644 --- a/SqlServer.2005/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2005).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005).sql index 3735ab76bf14..1dc222719250 100644 --- a/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2005).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005).sql b/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005).sql index 1bbd8095c84e..93b14c947211 100644 --- a/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2005).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005).sql b/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005).sql index 0c22cd75563f..9bfbebc2fcf8 100644 --- a/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2005).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005).sql b/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005).sql index 0c22cd75563f..9bfbebc2fcf8 100644 --- a/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005).sql +++ b/SqlServer.2005/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2005).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.LinqService).sql new file mode 100644 index 000000000000..6924bbf09882 --- /dev/null +++ b/SqlServer.2008.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2008.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.LinqService).sql new file mode 100644 index 000000000000..d13928a2df2c --- /dev/null +++ b/SqlServer.2008.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2008.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.LinqService).sql index c982da310511..f722432e4f9d 100644 --- a/SqlServer.2008.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2008.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.LinqService).sql index 50c63138c131..d2e8dd2f8583 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2008.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.LinqService,False).sql b/SqlServer.2008.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.LinqService,False).sql index b48a3be120fc..6bc68071accd 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.LinqService,False).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2008 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2008 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2008.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.LinqService).sql index efc569bfa7f7..a60fb5f16057 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.LinqService).sql index 02e24c636dba..9b65d396f65c 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.LinqService).sql index 436c8d3a18dd..a16d4cfd18aa 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.LinqService).sql index 5a3330ebca86..8965e3a12c2b 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.LinqService).sql index 1fa7880d7418..d786a9107e85 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2008 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.LinqService).sql index 1fa7880d7418..d786a9107e85 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2008 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.LinqService).sql index e4ba12fb17fc..de451918d2e2 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.LinqService).sql index 3f0cc8f2ddee..4a51a365a208 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.LinqService).sql index 049ecb332aac..8753139dce45 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.LinqService).sql index eed706d0713f..e8416c7ff140 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.LinqService).sql index 73cb7b7c1ac2..3064aa9a8038 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.LinqService).sql index 73cb7b7c1ac2..3064aa9a8038 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.LinqService).sql index a27f34adb80c..45abeaa26f0e 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.LinqService).sql index a27f34adb80c..45abeaa26f0e 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.LinqService).sql index a3868a53979c..ee631ef35e81 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2008.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.LinqService).sql index e0ddbfe2a37c..e11abe76585d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.LinqService).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2008.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.LinqService).sql new file mode 100644 index 000000000000..9aee27f1998f --- /dev/null +++ b/SqlServer.2008.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.LinqService).sql index 3bcc2199f844..74ba88684e22 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.LinqService).sql index fff0ff39b548..b6a77d5dd5c4 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.LinqService).sql index 1d02179eae36..240659dbaf7c 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.LinqService).sql index 0ef14b85be7f..d5a5bc8c22b3 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2008 (asynchronously) SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.LinqService).sql index c2285eae1027..bf38f496ee05 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 (asynchronously) SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.LinqService).sql index 42103558a896..9cb384d06893 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.LinqService).sql index bd680ee39476..8e23b8a0c49d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.LinqService).sql index 8749e223c5c6..7da952bae02b 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.LinqService).sql index ad3043f564c1..04dbeff3352b 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.LinqService).sql index 8598fa207a6a..c1d9d76be22c 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.LinqService).sql @@ -2,93 +2,41 @@ -- SqlServer.2008 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.LinqService).sql index ec73fe1052a2..7a9a2248f29d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.LinqService).sql index 24848dcb0ebb..b48674e364c2 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.LinqService).sql @@ -2,23 +2,23 @@ -- SqlServer.2008 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.LinqService).sql index 5bafa73b232e..a7c417c39f2e 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.LinqService).sql index 34f2dbccac27..a0580b0d8408 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.LinqService).sql index 8e93f908caf3..5708fc7cd8a0 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.LinqService).sql index 5bb374dea775..a2ebb3024554 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.LinqService).sql index 29fc85d0a54d..4e428aad0964 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.LinqService).sql index 9531e075885b..ebd5e15be2cc 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,1).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,1).sql index 14ba863f551e..024e0a1ef0b7 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,2).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,2).sql index 14ba863f551e..024e0a1ef0b7 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,1).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,1).sql index 29fc85d0a54d..4e428aad0964 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,1).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,2).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,2).sql index 29fc85d0a54d..4e428aad0964 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,2).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.LinqService).sql index 04ac58c9afee..6efc9f0a8c2d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.LinqService).sql index 29fc85d0a54d..4e428aad0964 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.LinqService).sql index 9531e075885b..ebd5e15be2cc 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.LinqService).sql index 16a5542b8998..3a724a71ec3d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.LinqService).sql index 54ea3a6359ad..ae418fdfaedf 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.LinqService).sql index 5bb374dea775..a2ebb3024554 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.LinqService).sql index 04ac58c9afee..6efc9f0a8c2d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.LinqService).sql index c918dec1eb29..388fc41a05bd 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.LinqService).sql index 71a98f922318..6c60391aa40d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.LinqService).sql index 71a98f922318..6c60391aa40d 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.LinqService).sql index 2e43161a002e..679c255406a3 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.LinqService).sql index 2e43161a002e..679c255406a3 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.LinqService).sql index 7cdd7209cb86..1d8a8df9af48 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2008.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.LinqService).sql index 23a13a9db9e6..bf8d0e439a60 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.LinqService).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2008.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.LinqService).sql new file mode 100644 index 000000000000..253826674344 --- /dev/null +++ b/SqlServer.2008.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2008 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.LinqService).sql index 9a152f2ab4ea..7c5a1b31c1ef 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.LinqService).sql index 606bab4b6e7d..de5a0a0a0895 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.LinqService).sql index da44bf79bff7..04cfe3ffafa9 100644 --- a/SqlServer.2008.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2008.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2008.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 47261680fe05..2841e1c06b26 100644 --- a/SqlServer.2008.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2008.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.LinqService).sql index 1eecb77e8f8a..87039a13f7e8 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.LinqService).sql index a5a658209430..74241b80c7b5 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.LinqService).sql index d8245f12467d..06bc350f68cb 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.LinqService).sql index d11f97887a74..b44610fba549 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.LinqService).sql index ae97c45ace8f..25d95700781c 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.LinqService).sql index 173f97d7f579..b4790419c485 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.LinqService).sql index e4f2aa8d0e32..a28c345b40db 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.LinqService).sql index 6f8b1b51e3aa..32a482d7efc2 100644 --- a/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.LinqService).sql index a95e16acbdeb..175894fb9873 100644 --- a/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.LinqService).sql b/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.LinqService).sql index a95e16acbdeb..175894fb9873 100644 --- a/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.LinqService).sql +++ b/SqlServer.2008.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.MS.LinqService).sql new file mode 100644 index 000000000000..2ca47ccb4c61 --- /dev/null +++ b/SqlServer.2008.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2008.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.MS.LinqService).sql new file mode 100644 index 000000000000..22ad6973af81 --- /dev/null +++ b/SqlServer.2008.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2008.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS.LinqService).sql index 7ad0f6965106..920500de0a9a 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS.LinqService).sql index 316b0351b4b6..645ac77c4ad4 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS.LinqService,False).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS.LinqService,False).sql index 3b160357df23..2a26627e8208 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS.LinqService,False).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS.LinqService).sql index 62dd44173717..a3ae906c6788 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS.LinqService).sql index 81e218338b71..ca9b8c21747f 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS.LinqService).sql index 12acd01d82ca..d20494cedab3 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS.LinqService).sql index 8ff262a5cc52..0c150e6a725e 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS.LinqService).sql index e0910eab4bec..32da1f59088c 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS.LinqService).sql index e0910eab4bec..32da1f59088c 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS.LinqService).sql @@ -2,22 +2,22 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS.LinqService).sql index 33073c265c8d..63dfb6bd5060 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS.LinqService).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS.LinqService).sql index 9bf6371cf5a6..a56e5303ba72 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS.LinqService).sql index 12b487d19a79..4a56761d60a1 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS.LinqService).sql index c6b473ce8f00..ad13ccd7132c 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS.LinqService).sql index 7181ae996bbd..3580f221a974 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS.LinqService).sql index 7181ae996bbd..3580f221a974 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS.LinqService).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS.LinqService).sql index ca6baf7e0e4f..1e05e177a1a5 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS.LinqService).sql index ca6baf7e0e4f..1e05e177a1a5 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS.LinqService).sql index bf76f675c1ab..c3ee0fca3735 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS.LinqService).sql index 25a9f8659db7..4d4a3f5ab90f 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS.LinqService).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS.LinqService).sql new file mode 100644 index 000000000000..fc267438906c --- /dev/null +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS.LinqService).sql index 8e7259af1816..1dfceaaeb667 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS.LinqService).sql index 6b6b192352af..f94da9fc536c 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS.LinqService).sql index f9b50bbfce2b..5d28c08f8349 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS.LinqService).sql index 2667c16c1741..0fef5b03013d 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS.LinqService).sql index 0fa582de167e..dead14fe4b9e 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS.LinqService).sql index 06033ddb277e..e0162d049189 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS.LinqService).sql index 1ad3020d7ce7..e18d8c8208ee 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS.LinqService).sql index 381a0b48827d..f2200754395d 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS.LinqService).sql index 7b0b580eaa1f..f77aba0db6ab 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS.LinqService).sql index ac678e2cf01b..7b4925cfb4ea 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS.LinqService).sql @@ -2,93 +2,41 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS.LinqService).sql index b6f8c7d6eb0b..a879aeffd0dc 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS.LinqService).sql index 1e8579a416ac..a09df80d51d4 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS.LinqService).sql @@ -2,23 +2,23 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS.LinqService).sql index 2b4ea7987c09..793b41ff6d7d 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS.LinqService).sql index d48cd1be0ec0..29964f18d176 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS.LinqService).sql index 0777ac0499be..de07669a4216 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS.LinqService).sql index 7e5367c5dd5f..d9795a166172 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS.LinqService).sql index ed383ce8f2e5..67762ee4f0b4 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS.LinqService).sql index 5aec3b0a1d25..f40b82ab7826 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,1).sql index 1650baba8b90..a16bc1b5b306 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,2).sql index 1650baba8b90..a16bc1b5b306 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,1).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,1).sql index ed383ce8f2e5..67762ee4f0b4 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,2).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,2).sql index ed383ce8f2e5..67762ee4f0b4 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS.LinqService,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS.LinqService).sql index 0bb315ebe735..2b57ef8ca138 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS.LinqService).sql index ed383ce8f2e5..67762ee4f0b4 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS.LinqService).sql index 5aec3b0a1d25..f40b82ab7826 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS.LinqService).sql index 07270b5dc6b6..2bb0f4583f75 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS.LinqService).sql index 4be18b6d5a97..118e42c2d81f 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS.LinqService).sql index 7e5367c5dd5f..d9795a166172 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS.LinqService).sql index 0bb315ebe735..2b57ef8ca138 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS.LinqService).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS.LinqService).sql index e9843ee12c86..183ce86f3890 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS.LinqService).sql index d9dfa76119ad..7deff55de891 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS.LinqService).sql index d9dfa76119ad..7deff55de891 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS.LinqService).sql index 1de54606b85e..4ed2911694b9 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS.LinqService).sql index 1de54606b85e..4ed2911694b9 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS.LinqService).sql index e24d967fe85b..82e4eecbf805 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS.LinqService).sql index 935629a30580..dcdb957bd220 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS.LinqService).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.MS.LinqService).sql new file mode 100644 index 000000000000..f01e7d25b0bb --- /dev/null +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS.LinqService).sql index 2f058335bc08..bd81529b7a58 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS.LinqService).sql index a21f098d1331..46ed8f800fd2 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS.LinqService).sql index fc5140a91b38..bf8d75c4a775 100644 --- a/SqlServer.2008.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2008.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2008.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 0691bd61326e..2c3d0c29889b 100644 --- a/SqlServer.2008.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2008.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 (asynchronously) diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS.LinqService).sql index 9d85917bc6ba..c4f09a13f2ee 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS.LinqService).sql index 6ebf084fae26..81d9d9918088 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS.LinqService).sql index 5602eb8b9ea9..ab6a0d19a22b 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS.LinqService).sql index 463911e160ce..6592e15b3cad 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS.LinqService).sql index 1a82c4dda3e8..de0d02d66488 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS.LinqService).sql index c4802847baa7..aaf895466379 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS.LinqService).sql index eb144a190106..fb183af6b7f7 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS.LinqService).sql index a4b99dbbc191..50e025e13391 100644 --- a/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS.LinqService).sql index 54d7289c91b0..f650bd6e69bf 100644 --- a/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS.LinqService).sql b/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS.LinqService).sql index 54d7289c91b0..f650bd6e69bf 100644 --- a/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS.LinqService).sql +++ b/SqlServer.2008.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008.MS).sql index b42efa04e657..a25d3aeafe03 100644 --- a/SqlServer.2008.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.MS).sql new file mode 100644 index 000000000000..3a6b88e6803c --- /dev/null +++ b/SqlServer.2008.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2008.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.MS).sql new file mode 100644 index 000000000000..30a57708e833 --- /dev/null +++ b/SqlServer.2008.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2008.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS).sql index 7498dd55037a..ca4861a36a88 100644 --- a/SqlServer.2008.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008.MS).sql index 553b2ed48036..79abccfeab03 100644 --- a/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008.MS).sql index 553b2ed48036..79abccfeab03 100644 --- a/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008.MS).sql index 3de3f18473bb..d1d660cb8c6c 100644 --- a/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2008.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS).sql index e4e6c38d62fb..d66440fd090e 100644 --- a/SqlServer.2008.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2008.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS,False).sql b/SqlServer.2008.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS,False).sql index 49c7ffd4d253..5c74c6b4faf9 100644 --- a/SqlServer.2008.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS,False).sql +++ b/SqlServer.2008.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2008.MS SqlServer.2008 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2008.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS).sql index 3f8a7c385b9e..aab4c749fab5 100644 --- a/SqlServer.2008.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS).sql index fa073c41807f..989de48464af 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS).sql index 496255f44244..7e75bfe5dec4 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS).sql index 711227cf1fb2..4c3866aae3b5 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS).sql index 7dbe8b37e4d4..b4372eb57f5a 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008.MS).sql @@ -2,22 +2,22 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS).sql index 7dbe8b37e4d4..b4372eb57f5a 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008.MS).sql @@ -2,22 +2,22 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS).sql index 9ddd73164d73..5b3e8c5f5f1f 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008.MS).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS).sql index 1dbbac1a0ba2..ebc60eb75ada 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS).sql index 53a4069bf23c..de42cc170ed2 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS).sql index 9a7360c8e6d8..abc7b26ea90d 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS).sql index d064b4e5dac4..a60a59ecdae9 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008.MS).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS).sql index d064b4e5dac4..a60a59ecdae9 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008.MS).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS).sql index cb28ec23a592..17edbde1dc17 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS).sql index ca6baf7e0e4f..1e05e177a1a5 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS).sql index de0c5719e1fa..827a4eedff4f 100644 --- a/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2008.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS).sql index 73b3e89b3689..d27fc1484fc7 100644 --- a/SqlServer.2008.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008.MS).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2008.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS).sql new file mode 100644 index 000000000000..a57688902b48 --- /dev/null +++ b/SqlServer.2008.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008.MS SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS).sql index 71db945dcce8..6631ea288bcf 100644 --- a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS).sql index c79f7ecc2ebd..94d574d7e3c2 100644 --- a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS).sql index 665a4a199c5c..7da747a824cc 100644 --- a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS).sql index e99aeebf30ac..1e034216742d 100644 --- a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS).sql index 2c83f665c1c5..21dbe36f4e69 100644 --- a/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008.MS).sql index 27d3f16d1580..7009352fac23 100644 --- a/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END,1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + ([a_Color].[Name],[t2].[Count_1],CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END), (NULL,0,NULL) diff --git a/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008.MS).sql index 4fdc06a1c3a5..fbb9b86cb481 100644 --- a/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,21 +34,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],CASE + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],CASE WHEN [t1].[ColorName] = N'Red' THEN [t1].[Count_1] ELSE 0 END,1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008.MS).sql index 1bedb40bbba6..31ac91215f9b 100644 --- a/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS).sql index eda97d481a4e..c03c95fedd9b 100644 --- a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS).sql index b7b23ff639ed..67f832b77602 100644 --- a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS).sql index 035cc04b9109..970abdffe030 100644 --- a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS).sql index 88a2c7f6db20..2136e0af1dac 100644 --- a/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS).sql index c5ce189f63b6..da93990602bf 100644 --- a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008.MS).sql @@ -2,93 +2,41 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2008.MS SqlServer.2008 diff --git a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS).sql index 2b9d7d5b7a34..0cff53b13ac3 100644 --- a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS).sql index 781b88d4d846..625922004230 100644 --- a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008.MS).sql @@ -2,23 +2,23 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS).sql index af0081ffa605..91de24421f47 100644 --- a/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS).sql index 295e48774949..24e734a20333 100644 --- a/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS).sql index 98b17e79d073..5db3c6e4421c 100644 --- a/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS).sql index fc70b765394a..e98136d87557 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS).sql index 5e0bab6f1946..402adfecd397 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS).sql index 939dd8dcf1ea..1ff0818fb43a 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,1).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,1).sql index 496ad1f2885a..49d592f3ea8e 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,1).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,2).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,2).sql index 496ad1f2885a..49d592f3ea8e 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,2).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,1).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,1).sql index 5e0bab6f1946..402adfecd397 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,1).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,2).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,2).sql index 5e0bab6f1946..402adfecd397 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,2).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008.MS,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS).sql index 2166986b55e2..dd08def27365 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS).sql index 5e0bab6f1946..402adfecd397 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS).sql index 939dd8dcf1ea..1ff0818fb43a 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS).sql index 7fe4c1844557..db0c6f58691a 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS).sql index 419bc43d0f34..e033d48f9c87 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS).sql index fc70b765394a..e98136d87557 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS).sql index 2166986b55e2..dd08def27365 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008.MS).sql @@ -2,13 +2,18 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS).sql index 3b958c8cfaa8..b92167ecb227 100644 --- a/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS).sql index 26fbf932f459..75d8c13a2ccd 100644 --- a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS).sql index 26fbf932f459..75d8c13a2ccd 100644 --- a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS).sql index c2b2c01ef671..e8c8a1eabb05 100644 --- a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS).sql index c2b2c01ef671..e8c8a1eabb05 100644 --- a/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008.MS SqlServer.2008 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS).sql index 2aeb19745e53..bd207ab802b4 100644 --- a/SqlServer.2008.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2008.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS).sql index 8e055782e74c..1662d6f8a150 100644 --- a/SqlServer.2008.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008.MS).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2008.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.MS).sql index dec9dea193ca..241dad4e823e 100644 --- a/SqlServer.2008.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2008.MS SqlServer.2008 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2008.MS SqlServer.2008 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2008.MS SqlServer.2008 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS).sql index 26c3792713dc..4ee1caa92d6a 100644 --- a/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS).sql index 23f6a542bbec..370b2185c836 100644 --- a/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS).sql index 420dfe0866df..4294bc8fd85f 100644 --- a/SqlServer.2008.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2008.MS SqlServer.2008 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2008.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2008.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index c23dc4b398da..9b4d71ddafec 100644 --- a/SqlServer.2008.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2008.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS).sql index 521fca82efd4..3b13f78f4601 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS).sql index 9c8d41855f1a..afa23b3078ec 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS).sql index fc219a1d8e8a..8805a24c0cd5 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008.MS).sql index fc219a1d8e8a..8805a24c0cd5 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS).sql index 0996a29bac29..7994ba6e10ee 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008.MS).sql index 201dd0db1127..824547a2e1f7 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008.MS).sql index 201dd0db1127..824547a2e1f7 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008.MS).sql index d3c5e36d6878..18f1d6e43cc2 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008.MS).sql @@ -3,7 +3,7 @@ SELECT CASE - WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000) + WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647) THEN 1 ELSE 0 END diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008.MS).sql index 5eedd9e162c0..c18a637ae37a 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008.MS).sql @@ -62,35 +62,30 @@ DECLARE @now DateTime2 SET @now = CAST('2020-02-29T17:54:55.1231234' AS DATETIME2) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y_1] + WHERE + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -147,35 +142,30 @@ DECLARE @now DateTime2 SET @now = CAST('2020-02-29T17:54:55.1230000' AS DATETIME2) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y_1] + WHERE + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS).sql index a949d4e75705..6e0c9d9a0c4b 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008.MS).sql index 21a4ffc37147..0f521afaf218 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS).sql index 0f935634e9c2..0aeaadf19932 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS).sql index a31f6e1d2918..6f580fcc2b70 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS).sql index 574283b5c32c..3cc82753725a 100644 --- a/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS).sql index 973b292f516c..72ab30b80d1a 100644 --- a/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS).sql b/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS).sql index 973b292f516c..72ab30b80d1a 100644 --- a/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS).sql +++ b/SqlServer.2008.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008).sql b/SqlServer.2008/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008).sql index 1bfb5ff22ec5..e41f548c420c 100644 --- a/SqlServer.2008/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2008).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008).sql b/SqlServer.2008/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008).sql new file mode 100644 index 000000000000..8b328829842e --- /dev/null +++ b/SqlServer.2008/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2008).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2008 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2008/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008).sql b/SqlServer.2008/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008).sql new file mode 100644 index 000000000000..b462f9e019d7 --- /dev/null +++ b/SqlServer.2008/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2008).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2008 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2008/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008).sql b/SqlServer.2008/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008).sql index 6133de87c060..82e8bb1059cd 100644 --- a/SqlServer.2008/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2008).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008).sql index 1ecde682012e..cd4a9f6d01ef 100644 --- a/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2008).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008).sql index 1ecde682012e..cd4a9f6d01ef 100644 --- a/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2008).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008).sql index 450210bb3d91..0a86d9cf77e3 100644 --- a/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2008).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2008/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008).sql index 4f5b2848cae2..d2b7c5e70c66 100644 --- a/SqlServer.2008/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2008).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2008/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008,False).sql b/SqlServer.2008/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008,False).sql index 3bfaa6274581..2ba6a53eb9fa 100644 --- a/SqlServer.2008/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008,False).sql +++ b/SqlServer.2008/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2008,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2008 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2008 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2008/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008).sql index 674dab81bc98..88164c85c8fe 100644 --- a/SqlServer.2008/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2008).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008).sql index 35b3a201ce22..e307c79aa381 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2008).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008).sql index 7e811803368f..5a91a7255fe9 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2008).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008).sql index 4c9850978ade..ae1ffe7c8811 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2008).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008).sql index fdce9706581a..623c89622c5d 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2008).sql @@ -2,22 +2,22 @@ -- SqlServer.2008 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008).sql index fdce9706581a..623c89622c5d 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2008).sql @@ -2,22 +2,22 @@ -- SqlServer.2008 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], + MAX([g_1].[ChildID]) as [Max_1], COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1], + END) as [Count_1], COUNT(CASE WHEN [g_1].[ChildID] > 10 THEN 1 ELSE NULL - END) as [COUNT_2] + END) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008).sql index 1eb2c045b750..ec9212c9e8ad 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2008).sql @@ -10,12 +10,12 @@ FROM COUNT(CASE WHEN [g_1].[ChildID] > 20 THEN 1 ELSE NULL - END) as [COUNT_1] + END) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008).sql index 49cd35db98e4..68ee4d29e520 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2008).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008).sql index 389423e86148..ae342e3caa4c 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2008).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008).sql index 2594fce8ef65..84dcb227c76c 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2008).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008).sql index a951b7af7b6a..3773a3e151f6 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2008).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008).sql index a951b7af7b6a..3773a3e151f6 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2008).sql @@ -15,9 +15,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] ) END FROM diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008).sql index c33c34f73d44..b9f8d27aca7e 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2008).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008).sql index a27f34adb80c..45abeaa26f0e 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2008).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008).sql index 234c3332e666..7e90cea6436d 100644 --- a/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2008).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2008/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008).sql index e91610a29f00..5d4daf04c341 100644 --- a/SqlServer.2008/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2008).sql @@ -4,21 +4,25 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], CASE WHEN [d].[ParentID] IS NOT NULL THEN [d].[ParentID] ELSE -100 - END as [ParentID] + END as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2008/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008).sql new file mode 100644 index 000000000000..7a8199a38f6b --- /dev/null +++ b/SqlServer.2008/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2008).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2008 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008).sql index 734ea8d8aea5..63d868edad76 100644 --- a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2008).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008).sql index ca18e2fa9f3c..f55a31f40be8 100644 --- a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2008).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008).sql index 1ba70bb6708e..37e4427bda04 100644 --- a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2008).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008).sql index 471580d9a472..1673e00a1619 100644 --- a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2008).sql @@ -2,13 +2,13 @@ -- SqlServer.2008 SELECT - [t4].[SUM_1], - [t8].[COUNT_1] + [t4].[Sum_1], + [t8].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t3].[DetailId]) as [SUM_1] + SUM([t3].[DetailId]) as [Sum_1] FROM ( SELECT @@ -34,7 +34,7 @@ FROM ) [t4] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008).sql index f1b158bd2c86..8e857439609c 100644 --- a/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2008).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 SELECT - [t4].[AVG_1] + [t4].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t3].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t3].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008).sql index 393205fad3a9..9b9e1877b9ff 100644 --- a/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2008).sql @@ -2,7 +2,6 @@ -- SqlServer.2008 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,21 +24,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END,1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -80,13 +78,13 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],CASE - WHEN [a_Color].[Name] = N'Red' THEN [t2].[COUNT_1] + ([a_Color].[Name],[t2].[Count_1],CASE + WHEN [a_Color].[Name] = N'Red' THEN [t2].[Count_1] ELSE 0 END), (NULL,0,NULL) diff --git a/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008).sql index 6b0cf00e51a7..d75922b5c147 100644 --- a/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2008).sql @@ -2,7 +2,6 @@ -- SqlServer.2008 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,21 +34,20 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],CASE + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],CASE WHEN [t1].[ColorName] = N'Red' THEN [t1].[Count_1] ELSE 0 END,1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008).sql index 7e83286fec58..61ecb063c573 100644 --- a/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2008).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008).sql index 3b14ddc0c51a..08ee8fc505a2 100644 --- a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2008).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008).sql index ea015d57bc29..c41364c71ed3 100644 --- a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2008).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008).sql index 2ebf1c5d616f..b2166c925ce0 100644 --- a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2008).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008).sql index b250d1190186..407c021add26 100644 --- a/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2008).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008).sql index 28ec8f2fc41a..c9b2c4436e06 100644 --- a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2008).sql @@ -2,93 +2,41 @@ -- SqlServer.2008 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 + ELSE NULL + END), + COUNT(DISTINCT CASE + WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN [t].[DataValue] + ELSE NULL + END), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(CASE - WHEN (Convert(Int, [t].[DataValue]) % 2) = 0 THEN 1 - ELSE NULL - END) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2008 diff --git a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008).sql index fcfdef5a2919..40abad148e01 100644 --- a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2008).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008).sql index bcfe9576a996..0a6ac8a639d0 100644 --- a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2008).sql @@ -2,23 +2,23 @@ -- SqlServer.2008 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1], + END) as [Min_1], MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_2] + END) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008).sql index e4b82e348443..95f932de849e 100644 --- a/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2008).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM MIN(CASE WHEN [g_1].[ParentID] > 2 THEN [g_1].[ChildID] ELSE NULL - END) as [MIN_1] + END) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008).sql index e340d4d2dde5..b66af695ed4d 100644 --- a/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2008).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008).sql index 931a747ae5d5..4895b1cc5554 100644 --- a/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2008).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008).sql index 08e0b3dc66c2..876b3e1f48ef 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2008).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008).sql index fac2b360ec40..72bf1ed3cab0 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2008).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008).sql index eec66378626a..0b898cefae68 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2008).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,1).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,1).sql index 0ec68ae6cc03..579327270c78 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,1).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,2).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,2).sql index 0ec68ae6cc03..579327270c78 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,2).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,1).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,1).sql index fac2b360ec40..72bf1ed3cab0 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,1).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,1).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,2).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,2).sql index fac2b360ec40..72bf1ed3cab0 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,2).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2008,ToEven,2).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008).sql index 613d9d92f5da..79cffb2b127c 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2008).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008).sql index fac2b360ec40..72bf1ed3cab0 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2008).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT @@ -10,8 +10,7 @@ FROM WHEN [p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1) THEN ROUND([p].[MoneyValue] / 2, 1) * 2 ELSE ROUND([p].[MoneyValue], 1) - END as [c1], - [p].[MoneyValue] + END as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008).sql index eec66378626a..0b898cefae68 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2008).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1) + THEN ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2 + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 1) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1) - THEN ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2 - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 1) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008).sql index 74cf43816359..1e5a70f4742a 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2008).sql @@ -2,9 +2,14 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008).sql index d5c74f8a50d5..bc5791408be8 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2008).sql @@ -2,9 +2,14 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008).sql index 08e0b3dc66c2..876b3e1f48ef 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2008).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN [p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0 + THEN FLOOR([p].[MoneyValue]) + ELSE ROUND([p].[MoneyValue], 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN [t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0 - THEN FLOOR([t].[MoneyValue]) - ELSE ROUND([t].[MoneyValue], 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008).sql index 613d9d92f5da..79cffb2b127c 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2008).sql @@ -2,13 +2,18 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + CASE + WHEN CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0 + THEN FLOOR(CAST([p].[MoneyValue] AS Float)) + ELSE ROUND(CAST([p].[MoneyValue] AS Float), 0) + END as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - CASE - WHEN CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0 - THEN FLOOR(CAST([t].[MoneyValue] AS Float)) - ELSE ROUND(CAST([t].[MoneyValue] AS Float), 0) - END <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008).sql index 2877cd134785..616be5c6e217 100644 --- a/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2008).sql @@ -2,9 +2,14 @@ -- SqlServer.2008 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008).sql index d697ce1cd0c9..434bf43982c1 100644 --- a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2008).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008).sql index d697ce1cd0c9..434bf43982c1 100644 --- a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2008).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2008 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2008 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2008 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2008 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008).sql index 4b68362ba4eb..f21d6dd6f0fb 100644 --- a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2008).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008).sql index 4b68362ba4eb..f21d6dd6f0fb 100644 --- a/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2008).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2008 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2008 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2008 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2008 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2008 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2008 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2008/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008).sql index 3ae12f9cd7d6..2827609d21d8 100644 --- a/SqlServer.2008/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2008).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2008/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008).sql index 4e6d51393793..568d5d950678 100644 --- a/SqlServer.2008/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2008).sql @@ -9,19 +9,19 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [t1].[Key_1], [t1].[Count_1], - [t1].[MAX_1] + [t1].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1], + MAX([summary].[FirstName]) as [Max_1], ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) as [RN] FROM [Person] [summary] diff --git a/SqlServer.2008/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008).sql index d047334c28b8..5179eb624882 100644 --- a/SqlServer.2008/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2008).sql @@ -2,7 +2,7 @@ -- SqlServer.2008 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2008 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2008 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2008 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008).sql index 7e908235a50f..054e923a7da3 100644 --- a/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2008).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008).sql index bae42cfe399b..32cbf9704f0e 100644 --- a/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2008).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008).sql b/SqlServer.2008/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008).sql index 013fd65a6433..caed3b81f982 100644 --- a/SqlServer.2008/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2008).sql @@ -2,12 +2,12 @@ -- SqlServer.2008 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2008/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2008/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index cda151d3bb68..f49aff9636c2 100644 --- a/SqlServer.2008/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2008/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2008,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008).sql index 50fc795f6a02..98921f8d10ba 100644 --- a/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2008).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008).sql index abb58118c165..429e892c0fb7 100644 --- a/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2008).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008).sql index 4046a0ca050b..5afbaa575000 100644 --- a/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2008).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008).sql index 4046a0ca050b..5afbaa575000 100644 --- a/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2008).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008).sql index c91acf6a76df..ce88219c5ecb 100644 --- a/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2008).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008).sql index 201dd0db1127..824547a2e1f7 100644 --- a/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2008).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008).sql index 201dd0db1127..824547a2e1f7 100644 --- a/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2008).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2008/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008).sql index b4d47de85127..063edfabf7dc 100644 --- a/SqlServer.2008/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2008).sql @@ -3,7 +3,7 @@ SELECT CASE - WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000) + WHEN N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647) THEN 1 ELSE 0 END diff --git a/SqlServer.2008/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008).sql index eff00936e89b..c100b3896815 100644 --- a/SqlServer.2008/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2008).sql @@ -62,35 +62,30 @@ DECLARE @now DateTime2 SET @now = CAST('2020-02-29T17:54:55.1231234' AS DATETIME2) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y_1] + WHERE + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -147,35 +142,30 @@ DECLARE @now DateTime2 SET @now = CAST('2020-02-29T17:54:55.1230000' AS DATETIME2) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y_1] + WHERE + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2008/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008).sql index 4d4b39f2426e..36f18254560d 100644 --- a/SqlServer.2008/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2008).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2008/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008).sql index 4b217d7bef2c..8cb575ad919c 100644 --- a/SqlServer.2008/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2008).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2008/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008).sql index c2908d54df46..80a939cff58d 100644 --- a/SqlServer.2008/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2008).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], CASE WHEN EXISTS( SELECT @@ -36,6 +36,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -43,12 +44,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008).sql index 9ea22ca55b01..2aefa5546c64 100644 --- a/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2008).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008).sql b/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008).sql index 6e9c7ddedee1..efb703bce000 100644 --- a/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2008).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008).sql b/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008).sql index 00cae8a8511d..1baf56ca2620 100644 --- a/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2008).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008).sql b/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008).sql index 00cae8a8511d..1baf56ca2620 100644 --- a/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008).sql +++ b/SqlServer.2008/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2008).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..c5c28a775d84 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2012.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..8411c5305c25 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2012.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.LinqService).sql index e4239f5ed2c2..a05c7b980e97 100644 --- a/SqlServer.2012.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2012.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.LinqService).sql index b3b19c239a21..e1c372aad49a 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2012.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.LinqService,False).sql b/SqlServer.2012.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.LinqService,False).sql index 0faa4dec58f8..61e0812a9a08 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.LinqService,False).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2012 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2012 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2012.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.LinqService).sql index 39abd7ecaf69..d5833d283cfd 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2012 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.LinqService).sql index b68299206b09..66cf47521a96 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.LinqService).sql index 31afbd5b52db..00bf59281a7d 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.LinqService).sql index 8de9afc3e4cd..3483206bf383 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.LinqService).sql index 804e7ad5cefa..9f32daa6859b 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2012 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.LinqService).sql index 804e7ad5cefa..9f32daa6859b 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2012 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.LinqService).sql index 2855ec87fb6d..f9d8f5965579 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.LinqService).sql index c32ecbda9b9e..5d6e5f43a504 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.LinqService).sql index 72726aac365d..ab37758403b8 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.LinqService).sql index 857c93779116..f3a377fedcaa 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2012 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.LinqService).sql index 73489b81c882..0144d0ee8345 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.LinqService).sql index 73489b81c882..0144d0ee8345 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.LinqService).sql index c335d7d52a8a..9f69cc76fa27 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.LinqService).sql index c335d7d52a8a..9f69cc76fa27 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.LinqService).sql index a915fea7a738..1b28dc684c69 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2012.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.LinqService).sql index cf54160c988e..0d6148b72e1e 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2012.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..0c6103d6c4d2 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.LinqService).sql index c554e3553702..2df893b77386 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.LinqService).sql index eb324da71f37..f474b2441ae9 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.LinqService).sql index e3b27726f225..4e6b107128c1 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.LinqService).sql index a5adbb5a5b20..ece5d1ad2004 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2012 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.LinqService).sql index f6f6dca3e0c1..fa34baf10b29 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.LinqService).sql index 92a4e70c1934..153e3f07ea91 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.LinqService).sql index cc8a0fcaf6c0..687a7e731b2c 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.LinqService).sql index 2b952ca0e6f8..7716e1b02286 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.LinqService).sql index aa17d9e44f25..f3b7a3878a0d 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.LinqService).sql index 69a359d56188..a43f1f40ae5b 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2012 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.LinqService).sql index cafe31e5e87b..ea1b3f5b1279 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.LinqService).sql index 0cdc7823fd26..75a8aaa8859a 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2012 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.LinqService).sql index 8be38fa14f39..3c16ead54504 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.LinqService).sql index 0e8e39572883..38a76d9be2d9 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.LinqService).sql index 194c3369b3ae..1b35ea36edab 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.LinqService).sql index 76544df27e51..dd82a1cccbd7 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.LinqService).sql index 413f7018de04..f1cb91096398 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.LinqService).sql index 364874f767a5..2c9720e0e0f2 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,1).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,1).sql index 2c24da3f8a76..8ce7da0037f9 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,2).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,2).sql index 2c24da3f8a76..8ce7da0037f9 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,1).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,1).sql index 413f7018de04..f1cb91096398 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,1).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,2).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,2).sql index 413f7018de04..f1cb91096398 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,2).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.LinqService).sql index 0b63ad0d0ee9..4e0af6322057 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.LinqService).sql index 413f7018de04..f1cb91096398 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.LinqService).sql index 364874f767a5..2c9720e0e0f2 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.LinqService).sql index a50fe0973b22..a7dda8cc013e 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.LinqService).sql index f6135865d0f6..3792a7e084df 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.LinqService).sql index 76544df27e51..dd82a1cccbd7 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.LinqService).sql index 0b63ad0d0ee9..4e0af6322057 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.LinqService).sql index 9cede7a9f9ea..15c63429fd91 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.LinqService).sql index 291b0e7b9a66..c2ef7ce3c22c 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.LinqService).sql index 291b0e7b9a66..c2ef7ce3c22c 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.LinqService).sql index 853cf580f718..06cd8f0873ee 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.LinqService).sql index 853cf580f718..06cd8f0873ee 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.LinqService).sql index fafb7593ee45..6766c167bd08 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2012.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.LinqService).sql index a1c49265176a..59cb67fecc62 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2012.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.LinqService).sql new file mode 100644 index 000000000000..cc6134b191a0 --- /dev/null +++ b/SqlServer.2012.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2012 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.LinqService).sql index 6f3324bb554e..7f63963eea7d 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.LinqService).sql index 5dfab12d5e86..1558bf49ed08 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.LinqService).sql index a6c0adf9dd0b..7e011418064a 100644 --- a/SqlServer.2012.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2012.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2012.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 0345ef038b80..202ffd4e4dfd 100644 --- a/SqlServer.2012.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2012.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.LinqService).sql index b9acfde2ded4..268b444b3735 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.LinqService).sql index 9221baac11ab..51a9328c25ae 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.LinqService).sql index 192c8fd329b3..6c938e43c286 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.LinqService).sql index bd199210ede4..ded65ba77727 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.LinqService).sql index 3e7361678c2e..fccb0b56e785 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.LinqService).sql index 6b484365ee39..af01a9711ba1 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.LinqService).sql index 7a37d1951dc4..7e9235199cb3 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.LinqService).sql index 737f26e12021..c856c5b3d4cd 100644 --- a/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.LinqService).sql index c9e7f1e27f1d..7bfed394434a 100644 --- a/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.LinqService).sql b/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.LinqService).sql index c9e7f1e27f1d..7bfed394434a 100644 --- a/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.LinqService).sql +++ b/SqlServer.2012.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..92c3bb126af8 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2012.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..302be946d4c6 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS.LinqService).sql index 74b3db686e8d..e45e8d6c7196 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS.LinqService).sql index 8290ca84e7e8..05574fc270e7 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS.LinqService,False).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS.LinqService,False).sql index 9bb4bd4a21d1..16036a384b9e 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS.LinqService,False).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS.LinqService).sql index 122f76552468..c3556bc6cbc5 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS.LinqService).sql index 259b1d1ce9f7..f85ef6bc9b79 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS.LinqService).sql index ea1c84021905..f067f5c8b0dc 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS.LinqService).sql index fc2e8736b918..29efa05e8f51 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS.LinqService).sql index a959a25aeb11..d2d8713c2560 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS.LinqService).sql index a959a25aeb11..d2d8713c2560 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS.LinqService).sql index 750864491f86..c4b2dcb959da 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS.LinqService).sql index 03f8de224780..85926ae2ca78 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS.LinqService).sql index 8771229bd444..8fea177f6d40 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS.LinqService).sql index 7394315a6262..b6e7cab57d1b 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS.LinqService).sql index 9a945dbb63b8..c4f55b565ccc 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS.LinqService).sql index 9a945dbb63b8..c4f55b565ccc 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS.LinqService).sql index 066afd4797ed..f8cd9a2191d3 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS.LinqService).sql index 066afd4797ed..f8cd9a2191d3 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS.LinqService).sql index 710a781a926a..4f4b667810d5 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS.LinqService).sql index abccd0538afa..ef1ba870b390 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..5f81d074abcd --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS.LinqService).sql index a8fc8468accd..b172c4d8a100 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS.LinqService).sql index 0f57fbbb3348..9f52947e5b41 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS.LinqService).sql index 1526bb355cac..67970cc1bda7 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS.LinqService).sql index 8f91ea0caae8..f47135bc82ca 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS.LinqService).sql index 0f5be1af0c59..e3ec197a0c2d 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS.LinqService).sql index 88aad51db970..d2e4a88fbc0c 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS.LinqService).sql index 1aad07a1a517..4938c0a9d4e0 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS.LinqService).sql index 3d8ea126a614..80e8f1116ccb 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS.LinqService).sql index 1250cb835948..ab3ce217e563 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS.LinqService).sql index 43a03607312e..e42f6d12fcf6 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS.LinqService).sql index 1cd0705f6dc7..c535cbabaf37 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS.LinqService).sql index d7b73c36a810..07ac62dac74c 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS.LinqService).sql index 311d85a6a716..1254b7649a8d 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS.LinqService).sql index d3959e6c2f2a..814da20bbb87 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS.LinqService).sql index 27d1909d08a7..d038b476e3bb 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS.LinqService).sql index e706ff2edcbd..bc3dc614edeb 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS.LinqService).sql index d751b37cd88b..47db78113fe1 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS.LinqService).sql index 07a344084c7a..7f38247b224a 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,1).sql index 120eec74a117..74b3906892cb 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,2).sql index 120eec74a117..74b3906892cb 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,1).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,1).sql index d751b37cd88b..47db78113fe1 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,2).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,2).sql index d751b37cd88b..47db78113fe1 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS.LinqService).sql index db8c440adcc4..fd96c845105f 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS.LinqService).sql index d751b37cd88b..47db78113fe1 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS.LinqService).sql index 07a344084c7a..7f38247b224a 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS.LinqService).sql index 68999d5652ba..30eb882b9341 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS.LinqService).sql index fd1da8aed9f7..6bfed77864e7 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS.LinqService).sql index e706ff2edcbd..bc3dc614edeb 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS.LinqService).sql index db8c440adcc4..fd96c845105f 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS.LinqService).sql index 84263f90ff19..7bead16c106f 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS.LinqService).sql index b0ce1968884d..e0f207a8538b 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS.LinqService).sql index b0ce1968884d..e0f207a8538b 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS.LinqService).sql index 5c5a0f5b03a2..df0eb2a03b89 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS.LinqService).sql index 5c5a0f5b03a2..df0eb2a03b89 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS.LinqService).sql index 5861ed210237..2dc42b4342ea 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS.LinqService).sql index fa5b265853b4..af4b6c6963ac 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.MS.LinqService).sql new file mode 100644 index 000000000000..2d02f4e8a035 --- /dev/null +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS.LinqService).sql index 7579b92a51e8..d59ea0e00d19 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS.LinqService).sql index 82474c10fee7..1eac5893b601 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS.LinqService).sql index a05ba9f94715..1658a65e4517 100644 --- a/SqlServer.2012.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2012.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2012.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index afc572b61f46..cee7452961e8 100644 --- a/SqlServer.2012.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2012.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 (asynchronously) diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS.LinqService).sql index 149053453ea7..a35dbc217e09 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS.LinqService).sql index 99694d6b67b0..a65db95b97cc 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS.LinqService).sql index b8362947fffb..397d140bd0ad 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS.LinqService).sql index a495b619c165..02b0723d4369 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS.LinqService).sql index aef0352bc1b0..d1b89ba70f4d 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS.LinqService).sql index c8ad66e5f91e..0abdb769e932 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS.LinqService).sql index 6ce1e89a30e6..485f33e44670 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS.LinqService).sql index 56630c5990b1..d2ae449e455f 100644 --- a/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS.LinqService).sql index 45a4a654c10d..06d3ef6de67b 100644 --- a/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS.LinqService).sql b/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS.LinqService).sql index 45a4a654c10d..06d3ef6de67b 100644 --- a/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS.LinqService).sql +++ b/SqlServer.2012.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012.MS).sql index 02aed5a1daf1..b82ca4772e86 100644 --- a/SqlServer.2012.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..891ddf91dc8d --- /dev/null +++ b/SqlServer.2012.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2012.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..55c76a39240a --- /dev/null +++ b/SqlServer.2012.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2012.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS).sql index 8ae5f1448b44..3189605d7ac9 100644 --- a/SqlServer.2012.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012.MS).sql index a04b16d501c0..40ce29c1dd4e 100644 --- a/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012.MS).sql index a04b16d501c0..40ce29c1dd4e 100644 --- a/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012.MS).sql index 60b4746fd6f3..cea54b2ae2de 100644 --- a/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2012.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS).sql index d349aca7dbca..449eed3ffd32 100644 --- a/SqlServer.2012.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2012.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS,False).sql b/SqlServer.2012.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS,False).sql index 1cd873b0689d..f09c808e1238 100644 --- a/SqlServer.2012.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS,False).sql +++ b/SqlServer.2012.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2012.MS SqlServer.2012 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2012.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS).sql index 86e19024fade..70a0bd1312ca 100644 --- a/SqlServer.2012.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS).sql index 0c2e509d67e9..6f3fd817170c 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS).sql index ade8d73b40ef..b378b4700248 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS).sql index e46ababd69c3..713afc5ba594 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS).sql index 7b7a181ed868..eecf67d8248e 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS).sql index 7b7a181ed868..eecf67d8248e 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS).sql index 21774510b689..5623101b1e20 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS).sql index a3e26d24d26e..2adcedf28436 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS).sql index c0fb03d6dec4..cdf0a9f35847 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS).sql index d9c18ed506bc..67ccb4d2c412 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS).sql index f255dd89f852..c1d00a0a75a3 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS).sql index f255dd89f852..c1d00a0a75a3 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS).sql index c4bb892237c8..d92a5d3e45e6 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS).sql index 066afd4797ed..f8cd9a2191d3 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS).sql index 40653ec5f177..71d43e981b44 100644 --- a/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2012.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS).sql index 6dd017fe8cf2..1a0f1c9348ab 100644 --- a/SqlServer.2012.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2012.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS).sql new file mode 100644 index 000000000000..2d7895ea431f --- /dev/null +++ b/SqlServer.2012.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012.MS SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS).sql index df33fefbaff3..af49cef7c7a1 100644 --- a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS).sql index 59746113b772..a40b41dde374 100644 --- a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS).sql index 16f52558ed59..76eeb41de155 100644 --- a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS).sql index be9be43eb0b8..202f36e86f00 100644 --- a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS).sql index 38186de76e0a..dc319772b2cd 100644 --- a/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012.MS).sql index f01c07584057..9ed7a49dc601 100644 --- a/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012.MS).sql index e6b7602e76dd..097bc1c01c0b 100644 --- a/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012.MS).sql index 6fe984c38798..b72a6ccc59f0 100644 --- a/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS).sql index 99d785fb76cc..49f629dc0000 100644 --- a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS).sql index 4979f7ebb8ac..4db2d82d600d 100644 --- a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS).sql index c228cb5ca781..951e696ff9d0 100644 --- a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS).sql index cd0df3a31709..9ab235974a59 100644 --- a/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS).sql index f98759210242..ab9c4c3985fa 100644 --- a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2012.MS SqlServer.2012 diff --git a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS).sql index 8f0879b33509..1e0b7ab4716b 100644 --- a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS).sql index 3bef8080f38c..56815fe64e64 100644 --- a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS).sql index 23b96f098d9c..7b76c0c4dc8f 100644 --- a/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS).sql index 2303a5d105bd..a74d0a298e13 100644 --- a/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS).sql index 7ff8a3a5574d..367cb131d128 100644 --- a/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS).sql index 1cb3748171da..bbd504c5812a 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS).sql index 08663c47eeef..9fa30693d3e0 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS).sql index b7c720b67f1d..9178699e378f 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,1).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,1).sql index 3f63f0d3ee41..7b67b7dd8c7a 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,1).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,2).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,2).sql index 3f63f0d3ee41..7b67b7dd8c7a 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,2).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,1).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,1).sql index 08663c47eeef..9fa30693d3e0 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,1).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,2).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,2).sql index 08663c47eeef..9fa30693d3e0 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,2).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS).sql index 7442cee63432..08d94ec31777 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS).sql index 08663c47eeef..9fa30693d3e0 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS).sql index b7c720b67f1d..9178699e378f 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS).sql index 1d9199f14079..1ea4a8561d8c 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS).sql index d5245c237519..4f59af3ccba7 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS).sql index 1cb3748171da..bbd504c5812a 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS).sql index 7442cee63432..08d94ec31777 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS).sql index 5bd9fb4efe6b..e8eb1f75e4e5 100644 --- a/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS).sql index 07e0ebca257a..34b43f6ec8e1 100644 --- a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS).sql index 07e0ebca257a..34b43f6ec8e1 100644 --- a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS).sql index e935c4d1db57..368878712ec6 100644 --- a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS).sql index e935c4d1db57..368878712ec6 100644 --- a/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS).sql index 430c2f29029e..fa1c0183db82 100644 --- a/SqlServer.2012.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2012.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS).sql index 843eb8da2c70..7c996dea304c 100644 --- a/SqlServer.2012.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2012.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.MS).sql index cb5a90525c2b..1cb77d654a45 100644 --- a/SqlServer.2012.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2012.MS SqlServer.2012 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2012.MS SqlServer.2012 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2012.MS SqlServer.2012 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS).sql index 9f5ff6eda093..a5b6e8f52286 100644 --- a/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS).sql index 3c9faea55b9a..ff6898e04dc7 100644 --- a/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS).sql index 988197ae8131..4b8a19f03df4 100644 --- a/SqlServer.2012.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2012.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2012.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 9829fe5ab9a9..269db02e7d0c 100644 --- a/SqlServer.2012.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2012.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS).sql index 25bc87c01e2c..22e9ed484539 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS).sql index c8b4484d0519..39af9460e3d7 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS).sql index f8b08af0576f..079ad02a45f3 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012.MS).sql index f8b08af0576f..079ad02a45f3 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS).sql index 8e3bdd9bc68c..b1040447e1e8 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012.MS).sql index 0354f69cf36a..60e15698e2b1 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012.MS).sql index 0354f69cf36a..60e15698e2b1 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012.MS).sql index 44013aa333f9..54138db4cbfe 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2012.MS SqlServer.2012 SELECT - IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000), 1, 0) + IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647), 1, 0) FROM [Issue1977Table] [f] diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012.MS).sql index 4d89b5a8052d..42e76dfaf6f0 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012.MS).sql @@ -62,35 +62,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -143,35 +138,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS).sql index 5e6bdfb62490..6ad56d82b218 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012.MS).sql index 94936be62063..fbcdd0b328a1 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS).sql index 9a53a562096c..f6c325d94355 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS).sql index 3eb512a36c7d..295a4c5b43ec 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS).sql index 4b8c6fe91d0d..540d93e2bf64 100644 --- a/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012.MS).sql index 9954e55fec3e..814959d257fe 100644 --- a/SqlServer.2012.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 @@ -1457,35 +1464,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1501,8 +1517,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2012.MS SqlServer.2012 diff --git a/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS).sql index 2a69ae9e08d1..99ed6896ad47 100644 --- a/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS).sql b/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS).sql index 2a69ae9e08d1..99ed6896ad47 100644 --- a/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS).sql +++ b/SqlServer.2012.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012).sql b/SqlServer.2012/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012).sql index ac1a43e55f99..c0d22a052b27 100644 --- a/SqlServer.2012/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2012).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012).sql b/SqlServer.2012/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012).sql new file mode 100644 index 000000000000..61d7d6e5c823 --- /dev/null +++ b/SqlServer.2012/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2012).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2012/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012).sql b/SqlServer.2012/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012).sql new file mode 100644 index 000000000000..60629406ef91 --- /dev/null +++ b/SqlServer.2012/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2012).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2012/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012).sql b/SqlServer.2012/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012).sql index f1ee14617c53..dd2d2beac20d 100644 --- a/SqlServer.2012/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2012).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012).sql index 9d38df51fe9b..03279d80c852 100644 --- a/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2012).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012).sql index 9d38df51fe9b..03279d80c852 100644 --- a/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2012).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012).sql index fc1f785304a1..51bc631e55c7 100644 --- a/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2012).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2012/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012).sql index 9558bfa273ae..ee7582eb9098 100644 --- a/SqlServer.2012/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2012).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2012/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012,False).sql b/SqlServer.2012/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012,False).sql index d9bb55ae1241..302ef4b91e30 100644 --- a/SqlServer.2012/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012,False).sql +++ b/SqlServer.2012/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2012,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2012 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2012 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2012/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012).sql index d52dba589921..e7956bc4974b 100644 --- a/SqlServer.2012/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2012).sql @@ -2,7 +2,7 @@ -- SqlServer.2012 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012).sql index 7accb234fe0f..43ede4fe4031 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2012).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012).sql index 73bba556312f..37218d6b6296 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2012).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012).sql index f1af301a8b80..7d3b9843e702 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2012).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012).sql index ba4063b87805..bd024a1aac99 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2012).sql @@ -2,16 +2,16 @@ -- SqlServer.2012 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012).sql index ba4063b87805..bd024a1aac99 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2012).sql @@ -2,16 +2,16 @@ -- SqlServer.2012 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012).sql index c815eb909639..677f7160b57c 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2012).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012).sql index 719afc297237..48551032d000 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2012).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012).sql index 6ef919572952..018e0c47e51e 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2012).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012).sql index b980d7107edb..8c3e2ee737b2 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2012).sql @@ -2,7 +2,7 @@ -- SqlServer.2012 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012).sql index ede7683549e7..481cc6662527 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2012).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012).sql index ede7683549e7..481cc6662527 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2012).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012).sql index 5a981523f6d5..86d2827d0112 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2012).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012).sql index c335d7d52a8a..9f69cc76fa27 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2012).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012).sql index 2c596a326cb3..928c0d421e5e 100644 --- a/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2012).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2012/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012).sql index 299e802a4804..995d07160c87 100644 --- a/SqlServer.2012/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2012).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2012/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012).sql new file mode 100644 index 000000000000..c7069a2363e6 --- /dev/null +++ b/SqlServer.2012/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2012).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2012 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012).sql index f6b2004aa2fb..d3c99efeba8a 100644 --- a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2012).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012).sql index 3cce803bf55b..0b6107a605e2 100644 --- a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2012).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012).sql index 3b0502c6c709..00024b62c34a 100644 --- a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2012).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012).sql index 526936c07f8a..c0b7ddc7009a 100644 --- a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2012).sql @@ -2,13 +2,13 @@ -- SqlServer.2012 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012).sql index f425dafe74bf..342108b8c01e 100644 --- a/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2012).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012).sql index 00f7f42ad2c4..2c41ad7c9c23 100644 --- a/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2012).sql @@ -2,7 +2,6 @@ -- SqlServer.2012 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012).sql index 771d2cedfae9..7a93cd0e9ee6 100644 --- a/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2012).sql @@ -2,7 +2,6 @@ -- SqlServer.2012 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012).sql index 010e0f4f6297..43cebbf4ae75 100644 --- a/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2012).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012).sql index 6e8df342c132..1466fa4b7b3d 100644 --- a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2012).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012).sql index 36d8cd85761d..4d793d90c088 100644 --- a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2012).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012).sql index 9b9c3de8a0b8..43e5d8b959bf 100644 --- a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2012).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012).sql index 8406a724a971..0661e7399e64 100644 --- a/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2012).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012).sql index 4948f6c4c142..ae4dd42f3846 100644 --- a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2012).sql @@ -2,87 +2,23 @@ -- SqlServer.2012 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2012 diff --git a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012).sql index 179b0cd20cef..b93198177282 100644 --- a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2012).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012).sql index 9e06dce2dc1d..38c5ee720b5f 100644 --- a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2012).sql @@ -2,17 +2,17 @@ -- SqlServer.2012 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012).sql index 4b1b392aa88b..6782f4d28940 100644 --- a/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2012).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012).sql index f07b702ca7c2..549167a1d4ca 100644 --- a/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2012).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012).sql index bf3c8578306e..a9a34754cc3a 100644 --- a/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2012).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012).sql index d5230700d7dd..089f7d402368 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012).sql index ccdb50543211..b527518113eb 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2012).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012).sql index d7f6f7ad665b..8de9a679adc1 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,1).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,1).sql index c50a36f02e1d..a2b53bf9b78d 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,1).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,2).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,2).sql index c50a36f02e1d..a2b53bf9b78d 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,2).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,1).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,1).sql index ccdb50543211..b527518113eb 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,1).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,2).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,2).sql index ccdb50543211..b527518113eb 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,2).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2012,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012).sql index ea69574aacbb..06afb5d0ff47 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012).sql index ccdb50543211..b527518113eb 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2012).sql @@ -2,12 +2,11 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012).sql index d7f6f7ad665b..8de9a679adc1 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012).sql index 2d7e15b23f3f..9932b0fb52c1 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012).sql index 2a3ae79b6f62..1da4ee5dbdfd 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012).sql index d5230700d7dd..089f7d402368 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012).sql index ea69574aacbb..06afb5d0ff47 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012).sql index d53cb6e0ed80..d7b213d6f81f 100644 --- a/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2012).sql @@ -2,9 +2,14 @@ -- SqlServer.2012 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012).sql index 5564473fe247..11c9b71c019f 100644 --- a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2012).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012).sql index 5564473fe247..11c9b71c019f 100644 --- a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2012).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2012 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2012 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2012 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2012 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012).sql index 706934a878c8..56140d76385c 100644 --- a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2012).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012).sql index 706934a878c8..56140d76385c 100644 --- a/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2012).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2012 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2012 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2012 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2012 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2012 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2012 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2012/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012).sql index d565a53fe8df..01096092b957 100644 --- a/SqlServer.2012/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2012).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2012/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012).sql index 07f24697c39e..881dfa5b323d 100644 --- a/SqlServer.2012/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2012).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2012/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012).sql index a5b6150fee39..9ca679da191c 100644 --- a/SqlServer.2012/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2012).sql @@ -2,7 +2,7 @@ -- SqlServer.2012 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2012 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2012 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2012 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012).sql index 17bc5189bc0f..a7d7dcee9867 100644 --- a/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2012).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012).sql index ec046aa47efe..efacd5c096af 100644 --- a/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2012).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012).sql b/SqlServer.2012/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012).sql index 3899de9229b4..8048386eaf3f 100644 --- a/SqlServer.2012/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2012).sql @@ -2,12 +2,12 @@ -- SqlServer.2012 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2012/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2012/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index c730fea6ca0a..cf0297a625d3 100644 --- a/SqlServer.2012/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2012/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2012,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012).sql index f8104b321cdc..45ddbe45df6f 100644 --- a/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2012).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012).sql index 4450520e4f92..0b4864eb4862 100644 --- a/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2012).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012).sql index 4e6cb3504aeb..256964b3f6a1 100644 --- a/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2012).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012).sql index 4e6cb3504aeb..256964b3f6a1 100644 --- a/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2012).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012).sql index 1395775e5fc8..0d18c8862f01 100644 --- a/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2012).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012).sql index 0354f69cf36a..60e15698e2b1 100644 --- a/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2012).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012).sql index 0354f69cf36a..60e15698e2b1 100644 --- a/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2012).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2012/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012).sql index f1b5ba2ffe6d..cbae1ddba095 100644 --- a/SqlServer.2012/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2012).sql @@ -2,7 +2,7 @@ -- SqlServer.2012 SELECT - IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000), 1, 0) + IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647), 1, 0) FROM [Issue1977Table] [f] diff --git a/SqlServer.2012/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012).sql index 18590c7b2c5f..10aef8525a91 100644 --- a/SqlServer.2012/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2012).sql @@ -62,35 +62,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -143,35 +138,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2012/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012).sql index 5d8cca90bbc5..2f0a5c3f318f 100644 --- a/SqlServer.2012/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2012).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2012/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012).sql index a05b1f6b1f86..ba6b896e368b 100644 --- a/SqlServer.2012/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2012).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2012/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012).sql index 8f7a2f40510b..f4a4fe54148b 100644 --- a/SqlServer.2012/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2012).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012).sql index a76e79c859b5..f0db66d06d16 100644 --- a/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2012).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012).sql index f408055b7fa1..11fa58737aa3 100644 --- a/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2012).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2012/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012).sql b/SqlServer.2012/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012).sql index 0d2b20616468..19a6788a073c 100644 --- a/SqlServer.2012/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2012).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2012 @@ -1457,35 +1464,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1501,8 +1517,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2012 diff --git a/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012).sql b/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012).sql index cca1f6591961..91114eb7602c 100644 --- a/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2012).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012).sql b/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012).sql index cca1f6591961..91114eb7602c 100644 --- a/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012).sql +++ b/SqlServer.2012/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2012).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..af28868b2254 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2014.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..b7cc91d6a936 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2014.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.LinqService).sql index 7b9cab0a9808..c1124c839a6c 100644 --- a/SqlServer.2014.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2014.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.LinqService).sql index 7e18da390437..b905dc0ca101 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2014.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.LinqService,False).sql b/SqlServer.2014.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.LinqService,False).sql index d0ba62e97aa9..db7bd05e7d27 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.LinqService,False).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2014 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2014 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2014.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.LinqService).sql index 1b63b73eb778..23dd03bdb546 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2014 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.LinqService).sql index 70b8332985c4..2c1b38508b7a 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.LinqService).sql index 25d71a74825d..53c90d158fdf 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.LinqService).sql index 2cfa54bb927e..3b553a1ec025 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.LinqService).sql index 953e0ea24890..cb7ca1311b7a 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2014 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.LinqService).sql index 953e0ea24890..cb7ca1311b7a 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2014 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.LinqService).sql index 92f20f9abadc..2e3dfa0ad54c 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.LinqService).sql index 734bf02cb416..7cc503988490 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.LinqService).sql index d79fc713a714..abd922827402 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.LinqService).sql index 52ec4599d3ab..7d57eb50d73e 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2014 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.LinqService).sql index 08b36c1c3ab1..3873d71843e1 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.LinqService).sql index 08b36c1c3ab1..3873d71843e1 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.LinqService).sql index 0fd10a0148de..4dcfa6aea102 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.LinqService).sql index 0fd10a0148de..4dcfa6aea102 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.LinqService).sql index c5863b543b38..fd07e503455b 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2014.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.LinqService).sql index 1c5adfb39e17..e840375aafa1 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2014.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..b2e5f54d878a --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.LinqService).sql index e7110e9fe436..4bb83f2cb488 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.LinqService).sql index 868ac6064e20..c5f26a774116 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.LinqService).sql index 2706c004d5e4..862f8bca72b8 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.LinqService).sql index 7a500b3e6c6d..0810b4a09964 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2014 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.LinqService).sql index e6e91f65bf90..88695d8a6002 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.LinqService).sql index b4f817b8c3aa..34a5d11bd436 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.LinqService).sql index 2d59ea53c259..87fc09cecec5 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.LinqService).sql index a7bf10564920..b1c9fef7e8f8 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.LinqService).sql index ce8ee925991a..823ad7ed9a89 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.LinqService).sql index e61e685888cd..10f0a67b3509 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2014 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.LinqService).sql index 602a10edcf12..faa403667b12 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.LinqService).sql index 7c1a029d0353..5317f41eb408 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2014 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.LinqService).sql index 806584b64111..5835a5c7fb84 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.LinqService).sql index 45ece7cea3d0..44c9533fcc16 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.LinqService).sql index 034c45e6f0d6..ff0eaa718424 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.LinqService).sql index 0bc5d5b70459..f45a737a9053 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.LinqService).sql index 6e5a68c5a729..d4481b5df13f 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.LinqService).sql index 2557a59a64d8..bb02551564ee 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,1).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,1).sql index 2406d2f9af1c..e04c2a9335b7 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,2).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,2).sql index 2406d2f9af1c..e04c2a9335b7 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,1).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,1).sql index 6e5a68c5a729..d4481b5df13f 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,1).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,2).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,2).sql index 6e5a68c5a729..d4481b5df13f 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,2).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.LinqService).sql index 623acfeaae88..ecafc2dad7f1 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.LinqService).sql index 6e5a68c5a729..d4481b5df13f 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.LinqService).sql index 2557a59a64d8..bb02551564ee 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.LinqService).sql index 548517c1c0e7..e086ae7b7490 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.LinqService).sql index b0d321af2a76..5b26c59aba43 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.LinqService).sql index 0bc5d5b70459..f45a737a9053 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.LinqService).sql index 623acfeaae88..ecafc2dad7f1 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.LinqService).sql index d4dcf20c9296..9fdca6e2f83c 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.LinqService).sql index a6ba55527bde..fb1faa1447b9 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.LinqService).sql index a6ba55527bde..fb1faa1447b9 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.LinqService).sql index 9427fd45bd07..6a44086421ca 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.LinqService).sql index 9427fd45bd07..6a44086421ca 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.LinqService).sql index 402ac1342020..2016a2137e72 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2014.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.LinqService).sql index a79607897d48..8088e2f065ae 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2014.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.LinqService).sql new file mode 100644 index 000000000000..373e7c257b01 --- /dev/null +++ b/SqlServer.2014.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2014 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.LinqService).sql index a3597045e99a..ddf9d2df1aed 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.LinqService).sql index c174c66327c7..8b6c5a0e9be9 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.LinqService).sql index 70ee5bc404b2..7ac742af1512 100644 --- a/SqlServer.2014.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2014.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2014.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index afb5f193f0de..7105aafdce50 100644 --- a/SqlServer.2014.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2014.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.LinqService).sql index 48ac95f72171..ac55cfc85bae 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.LinqService).sql index 7896757a2a73..9d1d6daf77a6 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.LinqService).sql index c27320880865..d84f24d4b743 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.LinqService).sql index dab0cca6d941..eed03029c3dd 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.LinqService).sql index fccb03863da5..20f34a913ee8 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.LinqService).sql index b7c3ad1c8020..58a24e179f60 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.LinqService).sql index e2b165ba2d9e..eaf50b7aed0f 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.LinqService).sql index 9975bb848b4d..9d5b54487208 100644 --- a/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.LinqService).sql index eb904c502bc1..d397907f217f 100644 --- a/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.LinqService).sql b/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.LinqService).sql index eb904c502bc1..d397907f217f 100644 --- a/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.LinqService).sql +++ b/SqlServer.2014.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..1077b1e4bcfc --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2014.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..50eae17f2873 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS.LinqService).sql index 6f56c1a29636..69c52e659993 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS.LinqService).sql index 818e6d9f6f60..2e2dfa0d0aad 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS.LinqService,False).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS.LinqService,False).sql index 9fbacb825edf..ba5ddd06afd7 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS.LinqService,False).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS.LinqService).sql index 9daa9f55acaf..ec9731ba0331 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS.LinqService).sql index cd5811ca5398..cd40fa8ca9af 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS.LinqService).sql index 3df527bf21c6..1b6aa799406f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS.LinqService).sql index ecae8688a587..e0cebb232b1d 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS.LinqService).sql index cf5fbf21919e..3f3e2f16867f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS.LinqService).sql index cf5fbf21919e..3f3e2f16867f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS.LinqService).sql index 2faf58fdd40a..8624607e99ed 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS.LinqService).sql index eb68a24c8cf5..7d60b0078d77 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS.LinqService).sql index 921323865cc6..efaa344ca1d9 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS.LinqService).sql index fa14122a568e..c088490286b4 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS.LinqService).sql index 6ce6112fee24..d9d25f4e4f36 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS.LinqService).sql index 6ce6112fee24..d9d25f4e4f36 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS.LinqService).sql index 3fd324c06acc..0b2aa961ecc4 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS.LinqService).sql index 3fd324c06acc..0b2aa961ecc4 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS.LinqService).sql index 2842b959d2c9..7934de43e512 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS.LinqService).sql index 95b39a438da3..b511e80c47d3 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..d63bfcd85857 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS.LinqService).sql index 5c4ede966533..1b2bc0c426f9 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS.LinqService).sql index 86745fdc67f1..e764b8e0167a 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS.LinqService).sql index 376047ee8095..f69c6aca7f99 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS.LinqService).sql index 155cc200d27c..848e8996ed0b 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS.LinqService).sql index 3d6a42653ef4..84f97d5b057c 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS.LinqService).sql index aa980ae4267a..d0e9c7ea7f13 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS.LinqService).sql index 2b505bdcaeb6..ac4f3543030f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS.LinqService).sql index 077ca8bbf214..3fdbf272d67f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS.LinqService).sql index be00f6628b34..a0b7459cb3c9 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS.LinqService).sql index 78dbe06603f9..75b9786e2a29 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS.LinqService).sql index 26b3153a2982..87aabdb29a7f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS.LinqService).sql index 319084963e0a..b43791baa238 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS.LinqService).sql index ede9ae0625da..bc3a35e7f6db 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS.LinqService).sql index 5f4cb01a0c8d..4d6e11daf0e2 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS.LinqService).sql index a1cc33e46a7f..22cd7f107e10 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS.LinqService).sql index 13951bd1e75d..8fe521d67b49 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS.LinqService).sql index 5466d693c7df..d6b9a53c50e3 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS.LinqService).sql index 4f505f4b8c2a..c59dabb9f1b1 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,1).sql index ddced00d828c..0141b9cb3b6c 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,2).sql index ddced00d828c..0141b9cb3b6c 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,1).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,1).sql index 5466d693c7df..d6b9a53c50e3 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,2).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,2).sql index 5466d693c7df..d6b9a53c50e3 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS.LinqService).sql index 9727c7a1b222..8c0fd6e519af 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS.LinqService).sql index 5466d693c7df..d6b9a53c50e3 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS.LinqService).sql index 4f505f4b8c2a..c59dabb9f1b1 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS.LinqService).sql index 7be9a3040d34..daa33ecb2a03 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS.LinqService).sql index 4d0e738e733c..7526ecc3d11c 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS.LinqService).sql index 13951bd1e75d..8fe521d67b49 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS.LinqService).sql index 9727c7a1b222..8c0fd6e519af 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS.LinqService).sql index 68fb1fa128a9..1fe8382e4a10 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS.LinqService).sql index 58b211cd9710..20438867a72f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS.LinqService).sql index 58b211cd9710..20438867a72f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS.LinqService).sql index f7a331f93fe2..31a58c6eb9f8 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS.LinqService).sql index f7a331f93fe2..31a58c6eb9f8 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS.LinqService).sql index 067cb73690e9..fc42198c628f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS.LinqService).sql index 94ab037edca0..09ebf16fc197 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.MS.LinqService).sql new file mode 100644 index 000000000000..d4eb8f556479 --- /dev/null +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS.LinqService).sql index b82e78ef6c40..0b5ea95d2f36 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS.LinqService).sql index c6d8f53cd172..b06028e4aca6 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS.LinqService).sql index faff229213ee..9f526de56a9e 100644 --- a/SqlServer.2014.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2014.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2014.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index bee7d36a6e90..e40c16e8a056 100644 --- a/SqlServer.2014.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2014.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 (asynchronously) diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS.LinqService).sql index 3504d715bd91..4382a49462fe 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS.LinqService).sql index 3dde3949b25e..78aa685ec22c 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS.LinqService).sql index c253607eb87f..beb4706a8447 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS.LinqService).sql index 08d7260e2aa4..4f46b0a6e456 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS.LinqService).sql index b71976ba126b..429e39a6742f 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS.LinqService).sql index 115501b3ed46..fb2771176363 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS.LinqService).sql index 2a3ab084862c..f20a3c4ca721 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS.LinqService).sql index 473de38016ed..13fc37a55804 100644 --- a/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS.LinqService).sql index 6c6f8d957fb1..099168865c3e 100644 --- a/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS.LinqService).sql b/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS.LinqService).sql index 6c6f8d957fb1..099168865c3e 100644 --- a/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS.LinqService).sql +++ b/SqlServer.2014.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014.MS).sql index b4d5374551e8..259c7f4ab7f4 100644 --- a/SqlServer.2014.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..d232bd3ce8c8 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2014.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..6364cae2de3f --- /dev/null +++ b/SqlServer.2014.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2014.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS).sql index a08569b68835..72bee2a5e802 100644 --- a/SqlServer.2014.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014.MS).sql index 4165f6560b13..96b44d2cffc6 100644 --- a/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014.MS).sql index 4165f6560b13..96b44d2cffc6 100644 --- a/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014.MS).sql index 35f410aa4e83..e4558c89265f 100644 --- a/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2014.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS).sql index 258aa8cbb4e0..d306a5d200c7 100644 --- a/SqlServer.2014.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2014.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS,False).sql b/SqlServer.2014.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS,False).sql index 50e2e8f6ce0e..a0bda3e9eae6 100644 --- a/SqlServer.2014.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS,False).sql +++ b/SqlServer.2014.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2014.MS SqlServer.2014 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2014.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS).sql index 2011ad8eae19..fdc0c599eb33 100644 --- a/SqlServer.2014.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS).sql index 15a95e39725a..42861c9e08ae 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS).sql index 33835f43dabc..2d7766bfe2f4 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS).sql index 6aee3019d2d8..33f496540427 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS).sql index 91ca9da6780d..d780aea5f23a 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS).sql index 91ca9da6780d..d780aea5f23a 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS).sql index c00e0d007248..e997f87679c4 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS).sql index f7c801da5954..33a91c33ac02 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS).sql index 047cb12a1805..a3a5d45fb6e1 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS).sql index 21386fd5e962..c988ae33bfc4 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS).sql index 657b26e13c5a..03505e81757c 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS).sql index 657b26e13c5a..03505e81757c 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS).sql index 1d646772bff3..80646b4bd727 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS).sql index 3fd324c06acc..0b2aa961ecc4 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS).sql index 2f619e25890f..c33425014f9d 100644 --- a/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2014.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS).sql index 4c7b0e1ae55c..3b481b3995ec 100644 --- a/SqlServer.2014.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2014.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS).sql new file mode 100644 index 000000000000..4c1f90efaf13 --- /dev/null +++ b/SqlServer.2014.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014.MS SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS).sql index be808c2ff979..3349082c88bb 100644 --- a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS).sql index 13dcecf92909..2f9ea63ab5c8 100644 --- a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS).sql index de954c6be89a..761c818d00e8 100644 --- a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS).sql index 3a9ba2f36f82..edccbc04c85c 100644 --- a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS).sql index 2e8b3f6597e7..cb1bf18dae89 100644 --- a/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014.MS).sql index 23a11d60700d..963aa63e1987 100644 --- a/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014.MS).sql index 98a0d70b49da..18d1ea28f428 100644 --- a/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014.MS).sql index cec6b1579e86..43f36748a78b 100644 --- a/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS).sql index 4fc252d1824f..a15a7f4084ca 100644 --- a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS).sql index f461673025b5..d3b67051f17f 100644 --- a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS).sql index 46bbc7163a1f..dcc6d77cf1cb 100644 --- a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS).sql index a343394b8f05..cd2b37c94a62 100644 --- a/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS).sql index 79115a203ef9..2c822d820d76 100644 --- a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2014.MS SqlServer.2014 diff --git a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS).sql index fcadb7e72bed..aa1ed8a7020b 100644 --- a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS).sql index 5e5c52b36065..937cd983e9b2 100644 --- a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS).sql index f3f67520cbf3..76036d47201a 100644 --- a/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS).sql index 3fd5d2ba05f6..def9f0b2994d 100644 --- a/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS).sql index 7a0ff01dcf83..6eb078ecc45c 100644 --- a/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS).sql index f73fcdcb7138..aca668043a50 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS).sql index 80a93804a9d3..675a836563a1 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS).sql index 2e454234fa95..463143415380 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,1).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,1).sql index 505306969a2b..eefc7e4f6aa7 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,1).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,2).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,2).sql index 505306969a2b..eefc7e4f6aa7 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,2).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,1).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,1).sql index 80a93804a9d3..675a836563a1 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,1).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,2).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,2).sql index 80a93804a9d3..675a836563a1 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,2).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS).sql index ffb93ee87e03..f8a89b6f593c 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS).sql index 80a93804a9d3..675a836563a1 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS).sql index 2e454234fa95..463143415380 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS).sql index 2a1c2dd77857..8c832e37d25b 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS).sql index 3455e8449349..b3be569ee066 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS).sql index f73fcdcb7138..aca668043a50 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS).sql index ffb93ee87e03..f8a89b6f593c 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS).sql index 48827bc0eff8..88073b8a3f3f 100644 --- a/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS).sql index 8e7c6100f202..fa3b7c5af462 100644 --- a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS).sql index 8e7c6100f202..fa3b7c5af462 100644 --- a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS).sql index 1c79bdbb2777..f7078abdbf7a 100644 --- a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS).sql index 1c79bdbb2777..f7078abdbf7a 100644 --- a/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS).sql index 484a5e3e42ec..b8720437bccd 100644 --- a/SqlServer.2014.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2014.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS).sql index 6c49603b17a1..ccc29bf0d4c9 100644 --- a/SqlServer.2014.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2014.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.MS).sql index 9c7373f08e7e..039e00102a34 100644 --- a/SqlServer.2014.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2014.MS SqlServer.2014 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2014.MS SqlServer.2014 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2014.MS SqlServer.2014 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS).sql index 32e02a7f7775..cc9dee1ea72a 100644 --- a/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS).sql index 24caff79c385..e75b8768eb79 100644 --- a/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS).sql index 1443bcf68de9..2564fb35aeeb 100644 --- a/SqlServer.2014.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2014.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2014.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index c53b3881f121..3c1de1f68fc8 100644 --- a/SqlServer.2014.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2014.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS).sql index 4ca2164fafb5..f58c1b9d25dd 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS).sql index e2328092d8e0..4a651e13ed5d 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS).sql index 8ef868cc89c5..c4f8452eb8a4 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014.MS).sql index 8ef868cc89c5..c4f8452eb8a4 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS).sql index b3d3b672b054..fd0b6826780f 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014.MS).sql index 5522d74198d5..f5fc0c7ff385 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014.MS).sql index 5522d74198d5..f5fc0c7ff385 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014.MS).sql index f6595719705c..cc9c21f1a19f 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2014.MS SqlServer.2014 SELECT - IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000), 1, 0) + IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647), 1, 0) FROM [Issue1977Table] [f] diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014.MS).sql index c6d547517cf6..b4d3cb0ab983 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014.MS).sql @@ -62,35 +62,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -143,35 +138,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS).sql index 48b70afe6dba..7bb302814d6a 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014.MS).sql index 469771b3476b..769af82e9ea8 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS).sql index 7379bdd9456b..98e990f463e1 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS).sql index a024167079a1..b69859fc0cec 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS).sql index a3c8d8998d3e..90069546a3b1 100644 --- a/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014.MS).sql index bc1063f844e1..ae612927b71f 100644 --- a/SqlServer.2014.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 @@ -1457,35 +1464,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1501,8 +1517,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2014.MS SqlServer.2014 diff --git a/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS).sql index 9530747f3b33..3367a6b15b77 100644 --- a/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS).sql b/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS).sql index 9530747f3b33..3367a6b15b77 100644 --- a/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS).sql +++ b/SqlServer.2014.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014).sql b/SqlServer.2014/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014).sql index 1b75725151fc..1693d7d388aa 100644 --- a/SqlServer.2014/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2014).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014).sql b/SqlServer.2014/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014).sql new file mode 100644 index 000000000000..8dfe5d74924a --- /dev/null +++ b/SqlServer.2014/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2014).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2014/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014).sql b/SqlServer.2014/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014).sql new file mode 100644 index 000000000000..fa8dd4a97881 --- /dev/null +++ b/SqlServer.2014/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2014).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2014/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014).sql b/SqlServer.2014/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014).sql index 4434d935b9f5..fa45daa0d943 100644 --- a/SqlServer.2014/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2014).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014).sql index c6d95865f079..a51de6f89287 100644 --- a/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2014).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014).sql index c6d95865f079..a51de6f89287 100644 --- a/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2014).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014).sql index 9020914cc571..fa00a55deab8 100644 --- a/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2014).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2014/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014).sql index d5eefee1df94..cf2a22fb16cd 100644 --- a/SqlServer.2014/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2014).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2014/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014,False).sql b/SqlServer.2014/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014,False).sql index 7ae571226e8e..b79c3346c719 100644 --- a/SqlServer.2014/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014,False).sql +++ b/SqlServer.2014/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2014,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2014 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2014 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2014/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014).sql index c9b04e0eaf05..c94e2015169a 100644 --- a/SqlServer.2014/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2014).sql @@ -2,7 +2,7 @@ -- SqlServer.2014 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014).sql index fb0d562adf99..ba8f5d934040 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2014).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014).sql index 7fd37d7ca7a7..272a887f9b50 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2014).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014).sql index a1e9e4f78be0..873e33c0cc4a 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2014).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014).sql index 83844a4e2cf2..3c4e82dbb487 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2014).sql @@ -2,16 +2,16 @@ -- SqlServer.2014 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014).sql index 83844a4e2cf2..3c4e82dbb487 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2014).sql @@ -2,16 +2,16 @@ -- SqlServer.2014 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014).sql index 15871cfe2161..677fa8231db7 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2014).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014).sql index d44c7efa5f60..7aadcdf096c9 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2014).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014).sql index 6a8de0b1c958..db397eef2f01 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2014).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014).sql index 1b7bc60d9219..57ee9870e942 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2014).sql @@ -2,7 +2,7 @@ -- SqlServer.2014 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014).sql index 48e4eee16663..a2be0da795ad 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2014).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014).sql index 48e4eee16663..a2be0da795ad 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2014).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014).sql index 705076f001bf..7a299daebe14 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2014).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014).sql index 0fd10a0148de..4dcfa6aea102 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2014).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014).sql index 3ae4b846882b..5f5bdeece41f 100644 --- a/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2014).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2014/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014).sql index 1292019c39c7..99d91d97e56c 100644 --- a/SqlServer.2014/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2014).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2014/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014).sql new file mode 100644 index 000000000000..96eaab30a949 --- /dev/null +++ b/SqlServer.2014/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2014).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2014 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014).sql index 70ef5c9efb14..d28c951c4b28 100644 --- a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2014).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014).sql index b3a5dd56214c..3db904d4efb9 100644 --- a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2014).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014).sql index 34781fbafb96..88b59619fbfb 100644 --- a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2014).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014).sql index d1d6310b8636..0165b1964f5e 100644 --- a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2014).sql @@ -2,13 +2,13 @@ -- SqlServer.2014 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014).sql index 24325a4ff998..e7fdf85be3de 100644 --- a/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2014).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014).sql index 3c5cb74affbd..bda464a24cc1 100644 --- a/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2014).sql @@ -2,7 +2,6 @@ -- SqlServer.2014 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014).sql index a410f7ea5687..f323d3981847 100644 --- a/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2014).sql @@ -2,7 +2,6 @@ -- SqlServer.2014 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014).sql index 5d8f4a65b3cd..6cd37e54b101 100644 --- a/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2014).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014).sql index ff508cdea0a3..bd4c4cc644bf 100644 --- a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2014).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014).sql index 82c6bd082e9b..41640e68b174 100644 --- a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2014).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014).sql index aceef2e49318..1fa8d0c2e395 100644 --- a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2014).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014).sql index 3631c70b840e..fadb50eff2b1 100644 --- a/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2014).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014).sql index 0796e0ac9ad3..f3d2a7897ce7 100644 --- a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2014).sql @@ -2,87 +2,23 @@ -- SqlServer.2014 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2014 diff --git a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014).sql index e5d05f5d26d8..78e7dd3bf970 100644 --- a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2014).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014).sql index e4890e5e6998..2f0dbfddd64c 100644 --- a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2014).sql @@ -2,17 +2,17 @@ -- SqlServer.2014 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014).sql index c55034a9b2f2..519e024c3bce 100644 --- a/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2014).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014).sql index 802e2d7f420c..6b92fa4eaddb 100644 --- a/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2014).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014).sql index 5fa40b11711a..57e6427a5e28 100644 --- a/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2014).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014).sql index 28558d37e70b..af6e230482a2 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014).sql index 9031aae4025e..125b87a21dd2 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2014).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014).sql index 21eb0c77abfc..d934e80e5f20 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,1).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,1).sql index 6df32780e6d1..3dfedb684b9d 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,1).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,2).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,2).sql index 6df32780e6d1..3dfedb684b9d 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,2).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,1).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,1).sql index 9031aae4025e..125b87a21dd2 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,1).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,2).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,2).sql index 9031aae4025e..125b87a21dd2 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,2).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2014,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014).sql index 9773c8920536..0e49a65b4e5a 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014).sql index 9031aae4025e..125b87a21dd2 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2014).sql @@ -2,12 +2,11 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014).sql index 21eb0c77abfc..d934e80e5f20 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014).sql index 428641164743..b26b3520bb51 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014).sql index d049901abaac..f081a785b21c 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014).sql index 28558d37e70b..af6e230482a2 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014).sql index 9773c8920536..0e49a65b4e5a 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014).sql index deb70611af48..be6cc795f645 100644 --- a/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2014).sql @@ -2,9 +2,14 @@ -- SqlServer.2014 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014).sql index aa413d8f22e3..c15c07bb8198 100644 --- a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2014).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014).sql index aa413d8f22e3..c15c07bb8198 100644 --- a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2014).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2014 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2014 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2014 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2014 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014).sql index c2057f1d27dd..156646531678 100644 --- a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2014).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014).sql index c2057f1d27dd..156646531678 100644 --- a/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2014).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2014 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2014 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2014 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2014 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2014 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2014 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2014/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014).sql index f7f9618d83d9..292e6c72fd9c 100644 --- a/SqlServer.2014/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2014).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2014/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014).sql index 1f2d8d0c54c3..084008861858 100644 --- a/SqlServer.2014/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2014).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2014/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014).sql index 2d5702a93396..cc1afcce75b2 100644 --- a/SqlServer.2014/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2014).sql @@ -2,7 +2,7 @@ -- SqlServer.2014 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2014 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2014 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2014 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014).sql index 3e6a4d97c75d..948fe4ed9aa2 100644 --- a/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2014).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014).sql index 723216752191..c3ab71a2de35 100644 --- a/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2014).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014).sql b/SqlServer.2014/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014).sql index f0ed986420da..c8ae1ea506fc 100644 --- a/SqlServer.2014/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2014).sql @@ -2,12 +2,12 @@ -- SqlServer.2014 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2014/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2014/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 8370d35c4747..2a5fd88f9c38 100644 --- a/SqlServer.2014/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2014/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2014,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014).sql index 356483310963..ee5e4d8a9d0e 100644 --- a/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2014).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014).sql index ce5d7fe0b95b..f4c25567c0c3 100644 --- a/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2014).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014).sql index 15620bcde9fb..41d721996c8f 100644 --- a/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2014).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014).sql index 15620bcde9fb..41d721996c8f 100644 --- a/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2014).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014).sql index 8842c3847888..7b1623d1a8db 100644 --- a/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2014).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014).sql index 5522d74198d5..f5fc0c7ff385 100644 --- a/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2014).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014).sql index 5522d74198d5..f5fc0c7ff385 100644 --- a/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2014).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2014/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014).sql index d9ee19513d47..e18974607a7e 100644 --- a/SqlServer.2014/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2014).sql @@ -2,7 +2,7 @@ -- SqlServer.2014 SELECT - IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000), 1, 0) + IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647), 1, 0) FROM [Issue1977Table] [f] diff --git a/SqlServer.2014/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014).sql index d5bf16dd37d7..fd027a7e359a 100644 --- a/SqlServer.2014/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2014).sql @@ -62,35 +62,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -143,35 +138,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2014/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014).sql index 499c3c6b7c1a..824623fa4bd5 100644 --- a/SqlServer.2014/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2014).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2014/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014).sql index 14950c447a2d..a7ec2b26205e 100644 --- a/SqlServer.2014/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2014).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2014/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014).sql index 5bb648a2f9fd..5bb917e29592 100644 --- a/SqlServer.2014/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2014).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014).sql index 856c289d93dc..19a35a080faa 100644 --- a/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2014).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014).sql index f65ace18182d..bd076ddf4879 100644 --- a/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2014).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2014/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014).sql b/SqlServer.2014/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014).sql index 48d250cccff5..b44339d04b71 100644 --- a/SqlServer.2014/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2014).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2014 @@ -1457,35 +1464,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1501,8 +1517,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2014 diff --git a/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014).sql b/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014).sql index 3567b45e3c10..48a928b91e7a 100644 --- a/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2014).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014).sql b/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014).sql index 3567b45e3c10..48a928b91e7a 100644 --- a/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014).sql +++ b/SqlServer.2014/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2014).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..9eb6a9484d9a --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2016.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..2ec907595ccc --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2016.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.LinqService).sql index 694803e6ff94..1bb72ed828ac 100644 --- a/SqlServer.2016.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2016.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.LinqService).sql index b3f15f1e5c52..68e89e51139f 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2016.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.LinqService,False).sql b/SqlServer.2016.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.LinqService,False).sql index 569bd6405e1f..dfc5dd50ded9 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.LinqService,False).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2016 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2016 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2016.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.LinqService).sql index fd41f65ccfbe..905adb8891a7 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.LinqService).sql index 9982d5d804c5..31c9d743dff1 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.LinqService).sql index d98a7a4408c3..9524b8e200f3 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.LinqService).sql index 91989fa4027e..c3dc50b04da9 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.LinqService).sql index 7962667e865d..f6f6dd14069a 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2016 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.LinqService).sql index 7962667e865d..f6f6dd14069a 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2016 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.LinqService).sql index 465e9e3e268d..249b8e6c8de8 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.LinqService).sql index f3cf673ea1f3..10040eae3abb 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.LinqService).sql index cf1038858b11..4738d611d07f 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.LinqService).sql index fcc02697c0ef..d85a089b106e 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.LinqService).sql index 71d864621669..460287cabc40 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.LinqService).sql index 71d864621669..460287cabc40 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.LinqService).sql index 8db27033efe4..2d7df40bf571 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.LinqService).sql index 8db27033efe4..2d7df40bf571 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.LinqService).sql index 57264f7ab9d0..c7908d422917 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2016.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.LinqService).sql index 5f7cd7a11c57..3730197aec95 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..566ef15a9d59 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.LinqService).sql index b69315ae80aa..9ddbef2a350d 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.LinqService).sql index ebbaf099b37c..c991e5936b57 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.LinqService).sql index f77008519dd4..be099cf06826 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.LinqService).sql index de648ae4a963..cfd2497bd78d 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2016 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.LinqService).sql index acdcd616096c..3af38112b6cd 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.LinqService).sql index 1bf1a12c6956..9051ac55fe62 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.LinqService).sql index e1e4ddedae1c..8e8f431858fd 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.LinqService).sql index 5689179c75e6..b7646c19f330 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.LinqService).sql index 4fbd91d0bd7e..cc20c6ab35f6 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.LinqService).sql index cdbff550fa97..d733a8eb7423 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2016 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.LinqService).sql index e2a0034f4759..3338ae2067e7 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.LinqService).sql index 30e2c395cad9..d6d144b86f59 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2016 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.LinqService).sql index 9993c390f024..627d2c7c0230 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.LinqService).sql index a616b02a76e8..3da218ae84c0 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.LinqService).sql index ff7126789440..19d3fce5eda7 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.LinqService).sql index d7cbbd376a31..c0d4f609ec6b 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.LinqService).sql index 256356dad663..6bff52fe1bda 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.LinqService).sql index d86d91b18001..b106e955a263 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,1).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,1).sql index 2d3e1bf9302a..b2acd68b0a97 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,2).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,2).sql index 2d3e1bf9302a..b2acd68b0a97 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,1).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,1).sql index 256356dad663..6bff52fe1bda 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,1).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,2).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,2).sql index 256356dad663..6bff52fe1bda 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,2).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.LinqService).sql index 0201c36d75e0..bdec328e43c0 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.LinqService).sql index 256356dad663..6bff52fe1bda 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.LinqService).sql index d86d91b18001..b106e955a263 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.LinqService).sql index 48499e31fd6c..42aacc2a41e5 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.LinqService).sql index 89d67a46336a..6e0fdc0a9bec 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.LinqService).sql index d7cbbd376a31..c0d4f609ec6b 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.LinqService).sql index 0201c36d75e0..bdec328e43c0 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.LinqService).sql index e88612f1f46c..d881d2a3b66c 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.LinqService).sql index 02b11c3d0bac..5316452f8acc 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.LinqService).sql index 02b11c3d0bac..5316452f8acc 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.LinqService).sql index 467d91e80eb9..106b40d6d243 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.LinqService).sql index 467d91e80eb9..106b40d6d243 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.LinqService).sql index 5334f354c397..7b49dc9f90d5 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2016.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.LinqService).sql index 8305e979226b..b317ff07c124 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2016.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.LinqService).sql new file mode 100644 index 000000000000..bf1b6eaf9ce5 --- /dev/null +++ b/SqlServer.2016.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2016 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.LinqService).sql index 52b64f06ca8f..0b79759f7d73 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.LinqService).sql index 9723cc6b41b0..b8c4aaca5cdc 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.LinqService).sql index 85915129feef..d61fd0263d59 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2016.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2016.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index e0a1a386aa21..a0bb5933a62f 100644 --- a/SqlServer.2016.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2016.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.LinqService).sql index 4a7c26d91df3..bb800a93ad55 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.LinqService).sql index 3efe3936c8e1..30c4d6692b56 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.LinqService).sql index 8f60913c5573..2d1ad7288d80 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.LinqService).sql index e524b5204cf4..b48d3a20972e 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.LinqService).sql index 82cb1b8d3629..ae76e23bc41f 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.LinqService).sql index 24fe06da2025..ac25d14cb554 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.LinqService).sql index 051b71dafb78..50c94e2148d2 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.LinqService).sql index 38970f0e5faf..f7a54f3278e6 100644 --- a/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.LinqService).sql index ec28168fa7ec..ff5c6d676e12 100644 --- a/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.LinqService).sql index ec28168fa7ec..ff5c6d676e12 100644 --- a/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql index 2835ed42c33d..9e435a0b3096 100644 --- a/SqlServer.2016.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2016.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql index 2835ed42c33d..9e435a0b3096 100644 --- a/SqlServer.2016.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2016.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql index 2835ed42c33d..9e435a0b3096 100644 --- a/SqlServer.2016.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2016.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..6d12136c15d0 --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2016.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..6e98aad2cb4d --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS.LinqService).sql index add568ae73d2..12e41ff5a648 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS.LinqService).sql index 8de8a17cc7c6..fe8957e827b6 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS.LinqService,False).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS.LinqService,False).sql index 978d8b4d567c..0683413b4cdc 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS.LinqService,False).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS.LinqService).sql index e800a1fcbf60..96bbc73cfc99 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS.LinqService).sql index 069a4e4fc91b..fe0232164cea 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS.LinqService).sql index 73d0e79b5dd5..b6e57a97af30 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS.LinqService).sql index 17a765e3bdbb..f8c7d489f498 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS.LinqService).sql index ada263412082..9c8e8cb5ea5d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS.LinqService).sql index ada263412082..9c8e8cb5ea5d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS.LinqService).sql index 671efa6ada94..f83e81af2ea2 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS.LinqService).sql index 2f37ec9385da..31554ecaeafe 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS.LinqService).sql index d4d2eb93ef9e..ff2f9468a4bc 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS.LinqService).sql index 02f00d870a6b..d6ed8c7ad3a8 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS.LinqService).sql index 7546220d3223..29b9600e6a3d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS.LinqService).sql index 7546220d3223..29b9600e6a3d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS.LinqService).sql index c45a75915892..6ad5ffb45b88 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS.LinqService).sql index c45a75915892..6ad5ffb45b88 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS.LinqService).sql index 8677e7f775d7..63ca0763810c 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS.LinqService).sql index 94a859d478f7..5cbae6058723 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..25c15cb1405f --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS.LinqService).sql index 0cac7500b45f..5a796a61c7f9 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS.LinqService).sql index 7e914537c23d..5632ca5d8b04 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS.LinqService).sql index 8b2786ff5347..2f30a5da3e5c 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS.LinqService).sql index 959c4a35736f..6a41bf7059ba 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS.LinqService).sql index 6ab323d3e8b6..07e6b8e6a70c 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS.LinqService).sql index 05668f5e7dda..b2902c008640 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS.LinqService).sql index a9314f42c0ed..d079c97923c9 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS.LinqService).sql index cbb2d6c30980..343498e79f1e 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS.LinqService).sql index dde362029fb7..2243d1ed4e50 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS.LinqService).sql index dcc63d94932c..a3718b8a2976 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS.LinqService).sql index 15eac95a10d1..fbedb13e82e7 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS.LinqService).sql index 48db0a8b6b86..d67255cc0055 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS.LinqService).sql index 6075f3e0f495..4196491b8c7a 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS.LinqService).sql index e91222c6e0ab..9c32e3dd936e 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS.LinqService).sql index 0034623ca551..dd6ec87d4b57 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS.LinqService).sql index 329326d85a7f..2dae40d3b8c0 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS.LinqService).sql index d251aeac8d1f..be5a828ad9d2 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS.LinqService).sql index a81df7b29b62..3e017ea8ae47 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,1).sql index 8b9369debff2..2ff60130c04d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,2).sql index 8b9369debff2..2ff60130c04d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,1).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,1).sql index d251aeac8d1f..be5a828ad9d2 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,2).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,2).sql index d251aeac8d1f..be5a828ad9d2 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS.LinqService).sql index 12c0444158e9..25d8bd10d5fc 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS.LinqService).sql index d251aeac8d1f..be5a828ad9d2 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS.LinqService).sql index a81df7b29b62..3e017ea8ae47 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS.LinqService).sql index ce2e7dd8b25c..11e8e0aeca24 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS.LinqService).sql index b5f19396f3a3..916a4e034b21 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS.LinqService).sql index 329326d85a7f..2dae40d3b8c0 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS.LinqService).sql index 12c0444158e9..25d8bd10d5fc 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS.LinqService).sql index 9255555af8dc..24a20fdc60c1 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS.LinqService).sql index 3aec771c675e..13a13826f502 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS.LinqService).sql index 3aec771c675e..13a13826f502 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS.LinqService).sql index 188d5b92a405..bc8574de2e36 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS.LinqService).sql index 188d5b92a405..bc8574de2e36 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS.LinqService).sql index 07f46bfcf89b..653e5aaeafe5 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS.LinqService).sql index b35e95c9bcd9..73ad703266ae 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.MS.LinqService).sql new file mode 100644 index 000000000000..ca5397b3fb6c --- /dev/null +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 (asynchronously) + +SELECT + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS.LinqService).sql index 92a52875c9cb..d2741f975965 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS.LinqService).sql index 390eddea4131..10ee4885343a 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS.LinqService).sql index b21638770519..f05e0122eb82 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2016.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2016.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 9aa0b3af199d..b36182e94b3f 100644 --- a/SqlServer.2016.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2016.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 (asynchronously) diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS.LinqService).sql index fc4779f7ad02..59d8c5348f51 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS.LinqService).sql index 5e5f998d6b5b..a738f2667499 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS.LinqService).sql index 3ffe691ff20f..800a100d5c7c 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS.LinqService).sql index 26a91ced0f87..5d1e170de986 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS.LinqService).sql index 70802f97634a..51f5412b6d83 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS.LinqService).sql index c8a412e26a5f..b3ac12b3ef9e 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS.LinqService).sql index 81a4990539b3..f1761d9e0aab 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS.LinqService).sql index 37332c1d8c14..5781e3b0b36b 100644 --- a/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS.LinqService).sql index 96409cb615ec..44d044542a4d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS.LinqService).sql index 96409cb615ec..44d044542a4d 100644 --- a/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016.MS).sql index 39daa9c9f080..2af41dbf101b 100644 --- a/SqlServer.2016.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..aac25cba55ed --- /dev/null +++ b/SqlServer.2016.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2016.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..3ef4e30e2f76 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2016.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS).sql index cca8f06ed1d1..a0221c7212e4 100644 --- a/SqlServer.2016.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016.MS).sql index 7f06362f626d..29c55e8eed48 100644 --- a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016.MS).sql index 7f06362f626d..29c55e8eed48 100644 --- a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016.MS).sql index 9d00e202b517..1b667111a482 100644 --- a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2016.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS).sql index 1a2f2f46b018..a63d54c43f93 100644 --- a/SqlServer.2016.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2016.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS,False).sql index 1e6ddca20c7c..864b6429e117 100644 --- a/SqlServer.2016.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS,False).sql +++ b/SqlServer.2016.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2016.MS SqlServer.2016 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2016.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS).sql index f40c53e996a2..300fa0ba9d9a 100644 --- a/SqlServer.2016.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS).sql index f98c7ec36850..c7884126aa8c 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS).sql index 5001d124032a..090542992ae7 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS).sql index 1fd32176743d..99d22806843c 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS).sql index 4e5a3f283025..bbcf2b315d21 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS).sql index 4e5a3f283025..bbcf2b315d21 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS).sql index 3fcd4af61d21..333935e2640b 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS).sql index 2d60cbcd1ab2..d2a2d7c50f74 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS).sql index 6a959ff9e6e3..42dc9801528c 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS).sql index 7e432436e028..c0632ca05845 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS).sql index fb37ee057c8e..463d76067555 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS).sql index fb37ee057c8e..463d76067555 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS).sql index 2d03b7e91ad8..7de4f8aebb5c 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS).sql index c45a75915892..6ad5ffb45b88 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS).sql index 5b906062cd44..3a23d5b9d6b0 100644 --- a/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2016.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS).sql index 8979c32bb3c3..d1d50141aa9b 100644 --- a/SqlServer.2016.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2016.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..6b25c477f7d4 --- /dev/null +++ b/SqlServer.2016.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS).sql index b9ef8bd8e895..8895aff40d2e 100644 --- a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS).sql index 3f6f22983591..f4d5981ef787 100644 --- a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS).sql index 560e9af23fa8..3c29a98beb22 100644 --- a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS).sql index 1b719751208c..4c74b263f2f6 100644 --- a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS).sql index 098d5a872aaa..1079f3a62e1b 100644 --- a/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016.MS).sql index 038c060ae490..c1cfeb1d4270 100644 --- a/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016.MS).sql index 703a6c964a89..7c316e4890c4 100644 --- a/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016.MS).sql index 768027065924..a150fd2a5ef6 100644 --- a/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS).sql index 7960a1ef2bf3..7d01f8fd6c5b 100644 --- a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS).sql index 7202915c55b9..b9b6702d3efe 100644 --- a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS).sql index beff5d7f2a11..769a9464cdb9 100644 --- a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS).sql index 4acf21c99379..ee4c6a0808ef 100644 --- a/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS).sql index b21ff4f16bc8..4b27e06541ce 100644 --- a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2016.MS SqlServer.2016 diff --git a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS).sql index 36fe331b6615..deb10dc7582c 100644 --- a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS).sql index 41f3902137eb..b28f28bb2614 100644 --- a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS).sql index 95b3fffd2b48..70cc52291b65 100644 --- a/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS).sql index 2e447b58e8fc..fe31852d208d 100644 --- a/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS).sql index b47ae2961eb0..8e90be0cf8cf 100644 --- a/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS).sql index 40f4d875c8b4..185a4d38efaa 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS).sql index bc00f37be8dc..5e8355ef7ae1 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS).sql index 1acc76e9ebc3..e3e86e6449c7 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,1).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,1).sql index 56aa538b271d..6c98c6cb8bc3 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,1).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,2).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,2).sql index 56aa538b271d..6c98c6cb8bc3 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,2).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,1).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,1).sql index bc00f37be8dc..5e8355ef7ae1 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,1).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,2).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,2).sql index bc00f37be8dc..5e8355ef7ae1 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,2).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS).sql index 5647472c8268..28202e7ebbef 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS).sql index bc00f37be8dc..5e8355ef7ae1 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS).sql index 1acc76e9ebc3..e3e86e6449c7 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS).sql index b926ae3c56f8..929904dcc3c1 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS).sql index 12c50755cd44..f372b1f36f96 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS).sql index 40f4d875c8b4..185a4d38efaa 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS).sql index 5647472c8268..28202e7ebbef 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS).sql index 0198d0af460f..6790118343a7 100644 --- a/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS).sql index 63de12573371..d043cee107a1 100644 --- a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS).sql index 63de12573371..d043cee107a1 100644 --- a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS).sql index 8eded87cefb1..216d6815f0d7 100644 --- a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS).sql index 8eded87cefb1..216d6815f0d7 100644 --- a/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS).sql index 8bda19d5d747..6005e25cb5d0 100644 --- a/SqlServer.2016.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2016.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS).sql index d870ae9a8143..dda56173b3ce 100644 --- a/SqlServer.2016.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2016.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.MS).sql index 25ec8613ef68..85d7930383be 100644 --- a/SqlServer.2016.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2016.MS SqlServer.2016 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2016.MS SqlServer.2016 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2016.MS SqlServer.2016 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS).sql index bb121fa59526..9fdb56370d04 100644 --- a/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS).sql index 952c56feae27..8269e4b988bc 100644 --- a/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS).sql index c3487d7a68c5..4fad866d7d1c 100644 --- a/SqlServer.2016.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2016.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2016.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index f30249935a6e..54769f58acb6 100644 --- a/SqlServer.2016.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2016.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS).sql index 324f4177bfae..7be5323d0335 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS).sql index 7202fdb245de..e84b82e73f25 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS).sql index 75bd6b9ddc1d..f4f838c19011 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016.MS).sql index 75bd6b9ddc1d..f4f838c19011 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS).sql index b94ca7baad79..3b6f7cf00ec9 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016.MS).sql index 9b94c2514a55..5504899f9222 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016.MS).sql index 9b94c2514a55..5504899f9222 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016.MS).sql index 3ccd66266765..50fcbcdef24f 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000), 1, 0) + IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647), 1, 0) FROM [Issue1977Table] [f] diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016.MS).sql index 0d7f564988b8..1cbf529fa091 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016.MS).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS).sql index 89d567d8632f..fc7f62c714b9 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016.MS).sql index 56d2ee5bca8a..bd0acae9aaff 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS).sql index 62ad8d000e7b..70124d132aec 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS).sql index 087e4722a2e6..5c91339a2989 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS).sql index c7ce74e7eb0d..96d9bc51c5e9 100644 --- a/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016.MS).sql index 6bcb1c49ba62..b94ac38433e3 100644 --- a/SqlServer.2016.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2016.MS SqlServer.2016 diff --git a/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS).sql index bf87a10cbf6c..9cba20b508c3 100644 --- a/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS).sql index bf87a10cbf6c..9cba20b508c3 100644 --- a/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016).sql b/SqlServer.2016/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016).sql index 9dd5e63450b7..2417d2bf28b3 100644 --- a/SqlServer.2016/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2016).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016).sql b/SqlServer.2016/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016).sql new file mode 100644 index 000000000000..efc908d13629 --- /dev/null +++ b/SqlServer.2016/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2016).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2016/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016).sql b/SqlServer.2016/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016).sql new file mode 100644 index 000000000000..d53d6ac78159 --- /dev/null +++ b/SqlServer.2016/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2016).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2016/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016).sql b/SqlServer.2016/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016).sql index 5b7cc9a724f6..bc60f95c734d 100644 --- a/SqlServer.2016/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2016).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016).sql index f4e94e6c84e8..b6ae059a15a8 100644 --- a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2016).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016).sql index f4e94e6c84e8..b6ae059a15a8 100644 --- a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2016).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016).sql index c41ed522feaa..1ef6b54a4ed8 100644 --- a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2016).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2016/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016).sql index 90f40a8e8ede..d20f057fe19b 100644 --- a/SqlServer.2016/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2016).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2016/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016,False).sql b/SqlServer.2016/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016,False).sql index 965b7baed877..66a3bc419193 100644 --- a/SqlServer.2016/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016,False).sql +++ b/SqlServer.2016/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2016,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2016 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2016 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2016/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016).sql index 83a6f2e3bde9..ded5fe26ca84 100644 --- a/SqlServer.2016/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016).sql index 8d018621cedb..bb08e2b75421 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2016).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016).sql index 3c7ce8d5abbb..705c7dc47ed0 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2016).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016).sql index a738030a19c3..1f117df9aaf3 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2016).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016).sql index 2c0f1c7e6e23..86af2eea3a42 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2016).sql @@ -2,16 +2,16 @@ -- SqlServer.2016 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016).sql index 2c0f1c7e6e23..86af2eea3a42 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2016).sql @@ -2,16 +2,16 @@ -- SqlServer.2016 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016).sql index 16c6d5d1ba8a..86d34ad6250d 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2016).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016).sql index f89353087e68..8ec58f70cc83 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2016).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016).sql index 5d8819d0970c..7bb44608128f 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2016).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016).sql index 92d1b691f7f3..a1ef35ef99c7 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016).sql index 86efdcc90f32..f03978ee3337 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2016).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016).sql index 86efdcc90f32..f03978ee3337 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2016).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016).sql index 43b62bfc634b..7650b2e05a34 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2016).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016).sql index 8db27033efe4..2d7df40bf571 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2016).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016).sql index 1ff49821bd74..788cd2807fe5 100644 --- a/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2016).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2016/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016).sql index a687ec67aeed..4852f20de223 100644 --- a/SqlServer.2016/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2016).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2016/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016).sql new file mode 100644 index 000000000000..cdea81afcd4e --- /dev/null +++ b/SqlServer.2016/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2016).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016).sql index 57dd3f69d461..b041be0a2580 100644 --- a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2016).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016).sql index 869ab73f1fc1..3c6efada0d9f 100644 --- a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2016).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016).sql index ba2b2f10724a..1ed78d9a3521 100644 --- a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2016).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016).sql index c985a252fcfa..467fca1d37fc 100644 --- a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2016).sql @@ -2,13 +2,13 @@ -- SqlServer.2016 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016).sql index 81e3c7e51443..0c115d484137 100644 --- a/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2016).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016).sql index bc8afb3f8559..4cda517354e0 100644 --- a/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2016).sql @@ -2,7 +2,6 @@ -- SqlServer.2016 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016).sql index 4519f1d6bda6..a33240863541 100644 --- a/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2016).sql @@ -2,7 +2,6 @@ -- SqlServer.2016 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016).sql index a84fd767c729..edc38a704f2e 100644 --- a/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2016).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016).sql index 0432b60965cf..4d04b6e439ed 100644 --- a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2016).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016).sql index 9f83a1a310e6..577ad0ad76ab 100644 --- a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2016).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016).sql index dd620102060b..ddd27d712380 100644 --- a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2016).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016).sql index 3d84afc9356a..6b1f5817b7a6 100644 --- a/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2016).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016).sql index 8c977ca30d41..7ec044e17821 100644 --- a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2016).sql @@ -2,87 +2,23 @@ -- SqlServer.2016 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2016 diff --git a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016).sql index b1baf59e8687..229deef9db7c 100644 --- a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2016).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016).sql index da76946e5963..a6ecd56e34db 100644 --- a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2016).sql @@ -2,17 +2,17 @@ -- SqlServer.2016 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016).sql index af48f7d26d78..4c59aefbe716 100644 --- a/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2016).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016).sql index c0a479929624..36638c1464d1 100644 --- a/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2016).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016).sql index 300e4ab92f7f..fe96d242a44f 100644 --- a/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2016).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016).sql index 7fde949f5134..bd5f02fb8492 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016).sql index 056602d2ffcd..375fd51729c2 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2016).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016).sql index a59629c5d64b..2e5a7fc37273 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,1).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,1).sql index 8e9e3c7e8253..bf955ca1f372 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,1).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,2).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,2).sql index 8e9e3c7e8253..bf955ca1f372 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,2).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,1).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,1).sql index 056602d2ffcd..375fd51729c2 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,1).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,2).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,2).sql index 056602d2ffcd..375fd51729c2 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,2).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2016,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016).sql index a43018e711b0..8b041b8dec1c 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016).sql index 056602d2ffcd..375fd51729c2 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2016).sql @@ -2,12 +2,11 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016).sql index a59629c5d64b..2e5a7fc37273 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016).sql index 75b2de9b4d4e..7f499a76a933 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016).sql index 2ad3672acafc..d5afd7e3e93c 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016).sql index 7fde949f5134..bd5f02fb8492 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016).sql index a43018e711b0..8b041b8dec1c 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016).sql index 26977073a168..eb4c248328e1 100644 --- a/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2016).sql @@ -2,9 +2,14 @@ -- SqlServer.2016 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016).sql index ccec66c60b31..2319348025e8 100644 --- a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2016).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016).sql index ccec66c60b31..2319348025e8 100644 --- a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2016).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2016 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2016 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2016 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2016 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016).sql index 61611ebf0278..4b8671a0b712 100644 --- a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2016).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016).sql index 61611ebf0278..4b8671a0b712 100644 --- a/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2016).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2016 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2016 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2016 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2016 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2016 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2016 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2016/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016).sql index a03ae0f3c6d5..5fad7b6739c8 100644 --- a/SqlServer.2016/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2016).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2016/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016).sql index c576ce2d70b0..dc9f494afb93 100644 --- a/SqlServer.2016/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2016).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2016/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016).sql index 6cb7c2916208..0d0f18c5db2a 100644 --- a/SqlServer.2016/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2016 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -22,7 +22,7 @@ BeforeExecute -- SqlServer.2016 SELECT - SUBSTRING(((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value1]), '')) + ISNULL((N' -> ' + [t].[Value2]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value1], '') + Coalesce(N' -> ' + [t].[Value2], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY @@ -32,7 +32,7 @@ BeforeExecute -- SqlServer.2016 SELECT - SUBSTRING((ISNULL((N' -> ' + [t].[Value3]), '') + ISNULL((N' -> ' + [t].[Value3]), '')), LEN(CONVERT(NVARCHAR(MAX), N' -> ') + N'!'), 8000) + SUBSTRING(Coalesce(N' -> ' + [t].[Value3], '') + Coalesce(N' -> ' + [t].[Value3], ''), 5, 2147483647) FROM [SampleClass] [t] ORDER BY diff --git a/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016).sql index 3e6f9394f4ae..e550a743b707 100644 --- a/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2016).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016).sql index 7e7a20885968..1ae831e7a7d8 100644 --- a/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2016).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016).sql index f9da79721498..4807fd9dc180 100644 --- a/SqlServer.2016/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2016).sql @@ -2,12 +2,12 @@ -- SqlServer.2016 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2016/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2016/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index a1e4d26526ce..f6099b10e632 100644 --- a/SqlServer.2016/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2016/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2016,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016).sql index ecc7f659bebc..abc4f70d7bde 100644 --- a/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2016).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016).sql index 0bf6bbb99d61..953e65ec5d25 100644 --- a/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2016).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016).sql index cf86fd89c747..a250fb648991 100644 --- a/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2016).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016).sql index cf86fd89c747..a250fb648991 100644 --- a/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2016).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016).sql index d2b46ff9e3f9..9c63d371f13b 100644 --- a/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2016).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016).sql index 9b94c2514a55..5504899f9222 100644 --- a/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2016).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016).sql index 9b94c2514a55..5504899f9222 100644 --- a/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2016).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2016/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016).sql index 8ac532cba1cc..593b29300fe3 100644 --- a/SqlServer.2016/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue1977Tests/Tests.UserTests.Issue1977Tests.Test(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(((ISNULL((N'/' + N'Issue1977Table'), '') + ISNULL((N'/' + CAST([f].[firstField] AS NVarChar(36))), '')) + ISNULL((N'/' + CAST([f].[secondField] AS NVarChar(36))), '')), LEN(CONVERT(NVARCHAR(MAX), N'/') + N'!'), 8000), 1, 0) + IIF(N'Issue1977Table/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)) = SUBSTRING(N'/Issue1977Table' + N'/' + CAST([f].[firstField] AS NVarChar(36)) + N'/' + CAST([f].[secondField] AS NVarChar(36)), 2, 2147483647), 1, 0) FROM [Issue1977Table] [f] diff --git a/SqlServer.2016/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016).sql index 4766cd422d2e..784f62f58586 100644 --- a/SqlServer.2016/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2016).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2016/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016).sql index 16d04065d892..5c07d7efe35d 100644 --- a/SqlServer.2016/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2016).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2016/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016).sql index 6b0d0229c994..1413ff911bde 100644 --- a/SqlServer.2016/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2016).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2016/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016).sql index 41e77575daff..d84dacaf8a1c 100644 --- a/SqlServer.2016/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2016).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016).sql index c8a83cf5d863..b1bf3089c518 100644 --- a/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2016).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016).sql index 6427b438ee1d..bc7c576a7f34 100644 --- a/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2016).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2016/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016).sql index 7e9d075ed325..d4fe7ebd6bec 100644 --- a/SqlServer.2016/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2016).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2016 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2016 diff --git a/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016).sql b/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016).sql index 3ee0e3d86abb..64fcca57122b 100644 --- a/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2016).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016).sql b/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016).sql index 3ee0e3d86abb..64fcca57122b 100644 --- a/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2016).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..32a3c374f268 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2017.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..db422c8a5d18 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2017.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.LinqService).sql index 725f9cb46b94..2bd73fa814de 100644 --- a/SqlServer.2017.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2017.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.LinqService).sql index da4e145484e0..0ee849cefcaf 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2017.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.LinqService,False).sql b/SqlServer.2017.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.LinqService,False).sql index b2481239960d..7c3e06e28a4e 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.LinqService,False).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2017 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2017 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2017.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.LinqService).sql index b93ad1c03c23..375d42b7c23a 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.LinqService).sql index e0656db16688..1857d2dbcc5f 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.LinqService).sql index ad0e0464adbf..f50ffa445206 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.LinqService).sql index d4593bde73e6..99b42da219fd 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.LinqService).sql index 56d3ceba9aeb..cae8742cdd96 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2017 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.LinqService).sql index 56d3ceba9aeb..cae8742cdd96 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2017 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.LinqService).sql index 2ca549617588..c0c79cf37a6a 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.LinqService).sql index 8fc7e146b6d6..d516eeda3a6c 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.LinqService).sql index 4a62370985dd..a6d051b5a89c 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.LinqService).sql index 16d1ee2d5010..26e35d00c437 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.LinqService).sql index c5285032057d..948a273df6f5 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.LinqService).sql index c5285032057d..948a273df6f5 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.LinqService).sql index 0004984f1f9e..3b6e0d35b746 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.LinqService).sql index 0004984f1f9e..3b6e0d35b746 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.LinqService).sql index 6ea741bad59e..4f77ac90f571 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2017.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.LinqService).sql index 1b8226bd21c8..7b06550e6020 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..a4474a3324dc --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.LinqService).sql index b871083679e4..b4aed62a0c92 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.LinqService).sql index 7395e7c7aa43..4ca6af82822b 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.LinqService).sql index 90024a096971..518259529a08 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.LinqService).sql index e2c42f6f5643..e6c0262b4233 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2017 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.LinqService).sql index 2920c9f5c59a..890cae29f856 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.LinqService).sql index 861be41b74c0..5cf05d78ea3a 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.LinqService).sql index 979b5e25beeb..2fac98a2fc77 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.LinqService).sql index d1e01fd2efe1..f606c8457474 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.LinqService).sql index fefed2de0d0f..654f3a2d4f70 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.LinqService).sql index 255a9acb384b..fd0726240355 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2017 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.LinqService).sql index da21e73ab2d1..a8711e62faf6 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.LinqService).sql index 1c3ec1fd0660..f276e14ecd7d 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2017 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.LinqService).sql index d46496613197..7b1fc51cf956 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.LinqService).sql index 568daf247fd0..a68375b2a0f5 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.LinqService).sql index c26d907e7d73..644bc00f0912 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.LinqService).sql index e65806a0668b..58c2bf6155a3 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.LinqService).sql index 912668f25093..f3eefa12a7aa 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.LinqService).sql index 7fe9e495170d..9a5f094f7815 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,1).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,1).sql index 051f45b1d8f9..80fa28358fb4 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,2).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,2).sql index 051f45b1d8f9..80fa28358fb4 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,1).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,1).sql index 912668f25093..f3eefa12a7aa 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,1).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,2).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,2).sql index 912668f25093..f3eefa12a7aa 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,2).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.LinqService).sql index 9027e709593b..0acf865da9cd 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.LinqService).sql index 912668f25093..f3eefa12a7aa 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.LinqService).sql index 7fe9e495170d..9a5f094f7815 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.LinqService).sql index 5f07a17e976c..cc72ee9435b5 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.LinqService).sql index 3f4778c12585..046eac2d77ba 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.LinqService).sql index e65806a0668b..58c2bf6155a3 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.LinqService).sql index 9027e709593b..0acf865da9cd 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.LinqService).sql index f9740b436a55..68b4cded1084 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.LinqService).sql index c485249c5459..8ff71ec55470 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.LinqService).sql index c485249c5459..8ff71ec55470 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.LinqService).sql index 771cd7d292c5..9e6f4fd8d51b 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.LinqService).sql index 771cd7d292c5..9e6f4fd8d51b 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.LinqService).sql index b1b468abcc8f..0133c2868721 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..06042b0a63db --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..9747a8eb3c0c --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..ec6d538fdf08 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..9ffc247ba918 --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..fd2675fcd5cc --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..fd2675fcd5cc --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..e4fa1af8d23c --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.LinqService).sql new file mode 100644 index 000000000000..29901e3cf53c --- /dev/null +++ b/SqlServer.2017.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.LinqService).sql index d3e704f7a34a..bb956e1ae536 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.LinqService).sql index 86b1b294cadc..b3324754ae4c 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.LinqService).sql index 0255d13933fa..f5764d61a687 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2017.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2017.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 012de8e1e983..fb7fc659a30b 100644 --- a/SqlServer.2017.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2017.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.LinqService).sql index 548f4b736669..73178f0ce501 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.LinqService).sql index bff0dd4bfae3..0fa125a4ea47 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.LinqService).sql index a37ef231fb14..dafa91cde5ee 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.LinqService).sql index 1b4c05b0391d..f58b8be622b0 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.LinqService).sql index 61431b3f5aac..cbf5da3e736c 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.LinqService).sql index 122b7ca7343f..2fc4088315b3 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.LinqService).sql index 2cb01973b57e..d727f3034c94 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.LinqService).sql index a3c367a9b665..578c19d7f32c 100644 --- a/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.LinqService).sql index a796c2ce7df7..b7013661781e 100644 --- a/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.LinqService).sql index a796c2ce7df7..b7013661781e 100644 --- a/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql index c8f7e72ccf51..d756f3343bdd 100644 --- a/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql index 399f10baf60b..f3799c3de524 100644 --- a/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql index c8f7e72ccf51..d756f3343bdd 100644 --- a/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql index 399f10baf60b..f3799c3de524 100644 --- a/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql index c8f7e72ccf51..d756f3343bdd 100644 --- a/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql index 399f10baf60b..f3799c3de524 100644 --- a/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2017.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..8842ab18232d --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2017.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..ffbd3ea8a5ff --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS.LinqService).sql index 367cc943ca92..6b29a26c2ce3 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS.LinqService).sql index a75a1975b420..b1fb1b7c1996 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS.LinqService,False).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS.LinqService,False).sql index e741280f98e5..afdfc5f4aca2 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS.LinqService,False).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS.LinqService).sql index 7bf8cceee82f..f36f6f978719 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS.LinqService).sql index ea626d21fb41..ebb5377b97d5 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS.LinqService).sql index 2b231b396955..82a2c23cb5d6 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS.LinqService).sql index a39a27e432cc..2cb30e3896d3 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS.LinqService).sql index 48b0465cab23..4387343080c0 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS.LinqService).sql index 48b0465cab23..4387343080c0 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS.LinqService).sql index a3adbc883f32..e73357517588 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS.LinqService).sql index 57909c4ec44e..9574002afbdb 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS.LinqService).sql index 05bfdef91fbf..9be2644af768 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS.LinqService).sql index 23577a4d5b07..d6833ac5682c 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS.LinqService).sql index 02798987a72d..2920dc1c2034 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS.LinqService).sql index 02798987a72d..2920dc1c2034 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS.LinqService).sql index d533e86f5f2d..524c9cbe5971 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS.LinqService).sql index d533e86f5f2d..524c9cbe5971 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS.LinqService).sql index c69460bdf952..2dc15a4ede37 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS.LinqService).sql index 643d666ed833..246cadba761f 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..36452d85ad2e --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS.LinqService).sql index 59d425f3a039..43fe57886803 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS.LinqService).sql index 2599f4f126af..12642487c4f4 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS.LinqService).sql index 132a9074c9f3..f890f6c95d0f 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS.LinqService).sql index 8adcfcbe33ea..c9156eb9dcb0 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS.LinqService).sql index 263e807ce6ea..eb8efe248554 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS.LinqService).sql index 811551d1f941..40e55e05de4f 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS.LinqService).sql index 6ea680d3946f..038fc1e32b5d 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS.LinqService).sql index b96dc7b23f0a..7c160f3afc12 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS.LinqService).sql index 13150a338068..bf30f7006151 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS.LinqService).sql index f74f6889fde8..10d0f2e49026 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS.LinqService).sql index 20651c35b4db..988bbf2f9fd9 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS.LinqService).sql index 62b067bc5e03..0cbef1aa0485 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS.LinqService).sql index 2fd4a51fec20..70b022e56165 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS.LinqService).sql index 1ce67efc54ed..dd3c7c499e79 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS.LinqService).sql index 4b2b4a6649bc..2517699a8872 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS.LinqService).sql index e432e57376d2..75d8232690b3 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS.LinqService).sql index 26366112c5ef..5469c0a02a78 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS.LinqService).sql index b2b4ed299992..44f7e1e3ccec 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,1).sql index f47714bc2e72..2a3c3883f98e 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,2).sql index f47714bc2e72..2a3c3883f98e 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,1).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,1).sql index 26366112c5ef..5469c0a02a78 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,2).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,2).sql index 26366112c5ef..5469c0a02a78 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS.LinqService).sql index 692712445153..32d51a8f8e13 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS.LinqService).sql index 26366112c5ef..5469c0a02a78 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS.LinqService).sql index b2b4ed299992..44f7e1e3ccec 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS.LinqService).sql index c8f3763fefa1..3f6b8ceae516 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS.LinqService).sql index 4d9a91eceb83..763dc572d97e 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS.LinqService).sql index e432e57376d2..75d8232690b3 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS.LinqService).sql index 692712445153..32d51a8f8e13 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS.LinqService).sql index 77277b0038b8..f9e95925b20b 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS.LinqService).sql index 365ed78b7fbd..4f630df17b38 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS.LinqService).sql index 365ed78b7fbd..4f630df17b38 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS.LinqService).sql index e622a2deaac6..62014fa5bfe6 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS.LinqService).sql index e622a2deaac6..62014fa5bfe6 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS.LinqService).sql index 9fdff88a48c8..dbacd07c68b0 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..bbf997540f66 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..1ed3dd544597 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..965e54d9ffdc --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..72c1ceabd132 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..2859cb04d091 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..2859cb04d091 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..172b5c950b63 --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.MS.LinqService).sql new file mode 100644 index 000000000000..248b5583b6bd --- /dev/null +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.MS.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS.LinqService).sql index e014cbc79d67..ffb173871bba 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS.LinqService).sql index 3ae10056ddc1..213aca787440 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS.LinqService).sql index ffa3047d8aac..27792b712c3d 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2017.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2017.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index fcda12e3a95e..c798780a7b71 100644 --- a/SqlServer.2017.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2017.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 (asynchronously) diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS.LinqService).sql index 81566c6394e7..f7e9d0227ed0 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS.LinqService).sql index 819083976fc3..a4bc9dbe2789 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS.LinqService).sql index f12c09d45533..8dbf63de4955 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS.LinqService).sql index ee6f8c339f0b..36bf189de5a4 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS.LinqService).sql index 294231981369..633d3bdbce81 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS.LinqService).sql index 5a2a29d08438..383289ef2cab 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS.LinqService).sql index 388edb8419db..c995cb3d8df2 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS.LinqService).sql index 7e520db48202..15d27d4d3e04 100644 --- a/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS.LinqService).sql index 7da9e8ed48a0..0fbfb6e2bfa1 100644 --- a/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS.LinqService).sql index 7da9e8ed48a0..0fbfb6e2bfa1 100644 --- a/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017.MS).sql index 691267ffaf24..8878d4db2699 100644 --- a/SqlServer.2017.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..93e9c4d282dc --- /dev/null +++ b/SqlServer.2017.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2017.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..8d1684a98283 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2017.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS).sql index 319f892775a6..f370c8bf5044 100644 --- a/SqlServer.2017.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017.MS).sql index 77389c5dcf10..6e69d879ab85 100644 --- a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017.MS).sql index 77389c5dcf10..6e69d879ab85 100644 --- a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017.MS).sql index 1501d6172b19..ce9e1870f2f0 100644 --- a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2017.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS).sql index ec184b077dc8..119bc7bcf652 100644 --- a/SqlServer.2017.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2017.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS,False).sql index d8892552d618..4136454ab6b1 100644 --- a/SqlServer.2017.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS,False).sql +++ b/SqlServer.2017.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2017.MS SqlServer.2017 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2017.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS).sql index a11ae3844e76..37a740d4dda6 100644 --- a/SqlServer.2017.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS).sql index 723a56e86af6..b10e63a4d91e 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS).sql index 40bb01848a5f..4683c4d90572 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS).sql index ddf2210d18f3..f7569d0bb203 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS).sql index ee25c9aa34f1..c5939f1c2453 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS).sql index ee25c9aa34f1..c5939f1c2453 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS).sql index ab7a14fee707..224f78e6f62b 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS).sql index 139054c9772e..327bfb19ee0a 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS).sql index e6cc97cb58b0..7fe530d2d011 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS).sql index 42a83e9f8a39..4d770900e187 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS).sql index ae12d0cfc268..4220cadf8ddf 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS).sql index ae12d0cfc268..4220cadf8ddf 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS).sql index 0e83d6ba0d03..66a004f1ffcf 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS).sql index d533e86f5f2d..524c9cbe5971 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS).sql index d3d230322ffd..da0bf9771417 100644 --- a/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2017.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS).sql index 4f9880689760..1edf0b8ca3a2 100644 --- a/SqlServer.2017.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2017.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..83d0e5eb7a02 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS).sql index 4a2553078080..2067761e5abe 100644 --- a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS).sql index da80110864e5..5a0a24fec95e 100644 --- a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS).sql index f268e38fc121..2e5c2acf04f6 100644 --- a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS).sql index 2596dada74db..85e3088bb79a 100644 --- a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS).sql index 4b8867c1d324..acf0497446c2 100644 --- a/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017.MS).sql index 62b515df230d..674c54303e7c 100644 --- a/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017.MS).sql index d8d3720ca4d3..e522b65cdca4 100644 --- a/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017.MS).sql index 94cbfaf1d1f0..041aee2b6532 100644 --- a/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS).sql index ebc279c573f4..960d2ca2353f 100644 --- a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS).sql index 7708289731a4..db92ba2d053a 100644 --- a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS).sql index c75cd931e2ca..46c24f59a413 100644 --- a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS).sql index 58847aab2ed2..37339eed4c55 100644 --- a/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS).sql index b9474c288538..4a7e4f979ef0 100644 --- a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2017.MS SqlServer.2017 diff --git a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS).sql index 42ec7ae42b22..f3a73162b165 100644 --- a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS).sql index 73af5fa4f79f..7bd9135068f9 100644 --- a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS).sql index ebc76bbf654a..9335d12d4a77 100644 --- a/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS).sql index ed7226c6fda1..21cacad9c833 100644 --- a/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS).sql index ed546dc6f331..d132fd20e4c5 100644 --- a/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS).sql index 79bdb50f4d2a..923699748d88 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS).sql index 92b6e201a390..24c89f72e94b 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS).sql index 5878378780ea..0e43cdb2e997 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,1).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,1).sql index 65fd28c564eb..5b9dc36ca52a 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,1).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,2).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,2).sql index 65fd28c564eb..5b9dc36ca52a 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,2).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,1).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,1).sql index 92b6e201a390..24c89f72e94b 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,1).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,2).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,2).sql index 92b6e201a390..24c89f72e94b 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,2).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS).sql index 8979c862985d..77952fdd7689 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS).sql index 92b6e201a390..24c89f72e94b 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS).sql index 5878378780ea..0e43cdb2e997 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS).sql index c29354d94ac4..0a4c0fb3d4a8 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS).sql index 1d5db463100f..832121e6afba 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS).sql index 79bdb50f4d2a..923699748d88 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS).sql index 8979c862985d..77952fdd7689 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS).sql index 48918553026e..7f9073442c0b 100644 --- a/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS).sql index f4c4bc752b25..089f728f0f05 100644 --- a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS).sql index f4c4bc752b25..089f728f0f05 100644 --- a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS).sql index d5bb2f00d88b..1fed22e8730e 100644 --- a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS).sql index d5bb2f00d88b..1fed22e8730e 100644 --- a/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS).sql index 52f578a702f8..ce9c6ccc650f 100644 --- a/SqlServer.2017.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2017.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.MS).sql index 57fd54b6530b..63b44d89709d 100644 --- a/SqlServer.2017.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2017.MS SqlServer.2017 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..ae58e034b93e --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017.MS).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..c41ff13197ac --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017.MS).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..2ca54a0784e2 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..2859cb04d091 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..8d3a3fcfb233 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..dbedaeec1510 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017.MS).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..2ed3805d7de6 --- /dev/null +++ b/SqlServer.2017.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017.MS).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS).sql index e330f830bab3..cb86a87b5dea 100644 --- a/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS).sql index 247dbf1d5816..c973cec614a5 100644 --- a/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS).sql index ea41f3096537..203c94e89499 100644 --- a/SqlServer.2017.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2017.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2017.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 2981b947f319..cd49a3f01bb9 100644 --- a/SqlServer.2017.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2017.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS).sql index aea2aa45204b..de2451e8b1c4 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS).sql index 066c65fe4358..5bd12e587936 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS).sql index 01c6ee108cd9..ef1e7b6ada8a 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017.MS).sql index 01c6ee108cd9..ef1e7b6ada8a 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS).sql index 4fa6c968e73d..32a7eb8799c0 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017.MS).sql index c6c8594f63ca..c2bacdf48c3e 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017.MS).sql index c6c8594f63ca..c2bacdf48c3e 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017.MS).sql index 8fdb261f1bc4..ce8d1615a916 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017.MS).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS).sql index 420598367d78..0bc63ddfa6e2 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017.MS).sql index 064dc7dab5fb..3b29852839b9 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS).sql index 3c015d040f94..89f7e172b3bb 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS).sql index 023a262189d9..dbc9028b4ca0 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS).sql index 15e0dcf29461..37718c3b8092 100644 --- a/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017.MS).sql index a19c2fd3f069..eadce2557aa2 100644 --- a/SqlServer.2017.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2017.MS SqlServer.2017 diff --git a/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS).sql index 0e0cf5256dbd..3989b8768b31 100644 --- a/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS).sql index 0e0cf5256dbd..3989b8768b31 100644 --- a/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017).sql b/SqlServer.2017/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017).sql index 803421c9dfca..e7eba1b07648 100644 --- a/SqlServer.2017/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2017).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017).sql b/SqlServer.2017/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017).sql new file mode 100644 index 000000000000..1923b33bc7e3 --- /dev/null +++ b/SqlServer.2017/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2017).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2017/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017).sql b/SqlServer.2017/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017).sql new file mode 100644 index 000000000000..2d59b12c8ead --- /dev/null +++ b/SqlServer.2017/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2017).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2017/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017).sql b/SqlServer.2017/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017).sql index 76a8bdc64d2f..18504f2baa68 100644 --- a/SqlServer.2017/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2017).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017).sql index f67e01de04b6..8b43d5d67027 100644 --- a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2017).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017).sql index f67e01de04b6..8b43d5d67027 100644 --- a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2017).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017).sql index eae4e9ccec87..93859f3111a1 100644 --- a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2017).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2017/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017).sql index 9daa9858316c..012e56e97a4b 100644 --- a/SqlServer.2017/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2017).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2017/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017,False).sql b/SqlServer.2017/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017,False).sql index 2c8d3ef87702..8137d74648b5 100644 --- a/SqlServer.2017/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017,False).sql +++ b/SqlServer.2017/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2017,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2017 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2017 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2017/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017).sql index 90914f8c5404..831debb69455 100644 --- a/SqlServer.2017/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017).sql index 83a5125e1fd2..36d51ee7d72a 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2017).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017).sql index 8cb0a170aa5d..f13e4fce07e6 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2017).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017).sql index 3ba4267298a0..691b05c875a9 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2017).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017).sql index 9788d0a5229c..02e22640f56f 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2017).sql @@ -2,16 +2,16 @@ -- SqlServer.2017 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017).sql index 9788d0a5229c..02e22640f56f 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2017).sql @@ -2,16 +2,16 @@ -- SqlServer.2017 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017).sql index f8f97a24bcf5..af0fac08f6b2 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2017).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017).sql index f6e8954ad846..aeb5929f8be2 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2017).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017).sql index 385c7541d42e..693504d0d0ad 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2017).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017).sql index d33ccf440fb0..1cc22a859c13 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017).sql index 3b75ebeb21b3..00d845718235 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2017).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017).sql index 3b75ebeb21b3..00d845718235 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2017).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017).sql index 1a6e7f8f5d6e..65764552ae99 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2017).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017).sql index 0004984f1f9e..3b6e0d35b746 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2017).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017).sql index bdc6ad8a7470..b9fea537771d 100644 --- a/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2017).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2017/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017).sql index 3ed6373b5bd1..6a02a11a776a 100644 --- a/SqlServer.2017/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2017).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2017/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017).sql new file mode 100644 index 000000000000..4739bc86201b --- /dev/null +++ b/SqlServer.2017/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2017).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017).sql index 7aedf4c717db..9211ceb11c32 100644 --- a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2017).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017).sql index 1dac1bd84c0b..abc7cd410a3b 100644 --- a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2017).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017).sql index ed630e90b3ba..8bf80029224a 100644 --- a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2017).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017).sql index b65522e2ed92..19dbd92fecb6 100644 --- a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2017).sql @@ -2,13 +2,13 @@ -- SqlServer.2017 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017).sql index 8806bb0a41f7..bd23e43aba2a 100644 --- a/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2017).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017).sql index 10b141938aa3..780e7c144e37 100644 --- a/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2017).sql @@ -2,7 +2,6 @@ -- SqlServer.2017 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017).sql index c1a2cc66168d..0abe4607629e 100644 --- a/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2017).sql @@ -2,7 +2,6 @@ -- SqlServer.2017 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017).sql index 6fd2a9781d2d..7b165f1a1182 100644 --- a/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2017).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017).sql index 3f094c8eac16..be34cc37545f 100644 --- a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2017).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017).sql index b078c7879b97..68b5db61a5fd 100644 --- a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2017).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017).sql index ef0073478396..753b0a08def2 100644 --- a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2017).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017).sql index 0cb29d2fabe0..471a51241118 100644 --- a/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2017).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017).sql index ac817fc3fbbc..18b9170d8e3e 100644 --- a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2017).sql @@ -2,87 +2,23 @@ -- SqlServer.2017 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2017 diff --git a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017).sql index 804c2118972b..f2649af8b4a1 100644 --- a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2017).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017).sql index 2925ce9fbc92..e50c9c88ab3a 100644 --- a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2017).sql @@ -2,17 +2,17 @@ -- SqlServer.2017 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017).sql index 9b46659c373e..e9308e4813da 100644 --- a/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2017).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017).sql index 42bccbd9f7bb..003f334525a7 100644 --- a/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2017).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017).sql index 74867df88678..0101e187ab2a 100644 --- a/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2017).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017).sql index a9cbc89e9682..3fa012a826f8 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017).sql index e6deabcfe873..457c584cdb30 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2017).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017).sql index b0a1e515e930..37c1f9209cef 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,1).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,1).sql index 8fe90363a698..c4cc7ecef769 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,1).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,2).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,2).sql index 8fe90363a698..c4cc7ecef769 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,2).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,1).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,1).sql index e6deabcfe873..457c584cdb30 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,1).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,2).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,2).sql index e6deabcfe873..457c584cdb30 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,2).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2017,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017).sql index ea953edbc1a9..989eae8a6c06 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017).sql index e6deabcfe873..457c584cdb30 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2017).sql @@ -2,12 +2,11 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017).sql index b0a1e515e930..37c1f9209cef 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017).sql index ee30a3eca561..70d847ad68df 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017).sql index bec8c46c87a7..21dda62fcc42 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017).sql index a9cbc89e9682..3fa012a826f8 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017).sql index ea953edbc1a9..989eae8a6c06 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017).sql index bca93ed03531..1e7c5d2e5302 100644 --- a/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2017).sql @@ -2,9 +2,14 @@ -- SqlServer.2017 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017).sql index 26b21027f68a..1920daff8bc6 100644 --- a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2017).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017).sql index 26b21027f68a..1920daff8bc6 100644 --- a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2017).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2017 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2017 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2017 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2017 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017).sql index fe099966fa76..8ca970a08654 100644 --- a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2017).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017).sql index fe099966fa76..8ca970a08654 100644 --- a/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2017).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2017 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2017 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2017 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2017 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2017 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2017 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2017/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017).sql index 0b3720b88943..70f92c1dadb5 100644 --- a/SqlServer.2017/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2017).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2017/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017).sql index fd4644383ac9..0b9d152393ca 100644 --- a/SqlServer.2017/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2017 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2017 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017).sql new file mode 100644 index 000000000000..44b92023d177 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2017).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017).sql new file mode 100644 index 000000000000..c7aa79b17d66 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2017).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017).sql new file mode 100644 index 000000000000..0a3c6abcde14 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2017).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017).sql new file mode 100644 index 000000000000..fd2675fcd5cc --- /dev/null +++ b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2017).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017).sql new file mode 100644 index 000000000000..36e9bc311b1c --- /dev/null +++ b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2017).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017).sql new file mode 100644 index 000000000000..f7617ad830f2 --- /dev/null +++ b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2017).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017).sql new file mode 100644 index 000000000000..817d52e9a86a --- /dev/null +++ b/SqlServer.2017/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2017).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017).sql index 8586c509c12d..1828950c6bcb 100644 --- a/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2017).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017).sql index 3693a7f4a9ac..f4cabb7c95f7 100644 --- a/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2017).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017).sql index 75c92ebddc51..407ad6ba1b91 100644 --- a/SqlServer.2017/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2017).sql @@ -2,12 +2,12 @@ -- SqlServer.2017 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2017/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2017/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 87f3f0122159..23f63b05597d 100644 --- a/SqlServer.2017/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2017/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2017,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017).sql index 42c44fe0f2d6..c6b38d1b664b 100644 --- a/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2017).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017).sql index 0f65dd672d50..c1b750674073 100644 --- a/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2017).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017).sql index d409869b618d..645f2c1b454c 100644 --- a/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2017).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017).sql index d409869b618d..645f2c1b454c 100644 --- a/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2017).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017).sql index 08414c09ed4d..fe247a8d39c6 100644 --- a/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2017).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017).sql index c6c8594f63ca..c2bacdf48c3e 100644 --- a/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2017).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017).sql index c6c8594f63ca..c2bacdf48c3e 100644 --- a/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2017).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2017/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017).sql index 0d570636069a..37e3246a8db6 100644 --- a/SqlServer.2017/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2017).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2017/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017).sql index 0d268096e63c..018393b53c9d 100644 --- a/SqlServer.2017/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2017).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2017/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017).sql index 28b3b8868bc7..60a76f47515b 100644 --- a/SqlServer.2017/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2017).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2017/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017).sql index 73e4b4cf6070..d0a744a8053e 100644 --- a/SqlServer.2017/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2017).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017).sql index 1fa5ff517aef..807204ef6bef 100644 --- a/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2017).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017).sql index fa2994ae387d..0c96fa56b44d 100644 --- a/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2017).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2017/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017).sql index c82062457ae7..91f9b8c781c1 100644 --- a/SqlServer.2017/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2017).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2017 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2017 diff --git a/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017).sql b/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017).sql index 5faaf12e02c0..3bd0977cf793 100644 --- a/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2017).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017).sql b/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017).sql index 5faaf12e02c0..3bd0977cf793 100644 --- a/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2017).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..bf819d7a87cf --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2019.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..7fef59436d7f --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2019.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.LinqService).sql index 4eb0e3ddf788..421c90f1e1a5 100644 --- a/SqlServer.2019.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2019.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.LinqService).sql index 71041fa72128..718e95035584 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2019.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.LinqService,False).sql b/SqlServer.2019.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.LinqService,False).sql index 6ed02270e313..b57179b0d008 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.LinqService,False).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2019 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2019 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2019.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.LinqService).sql index 5899597ce41e..6eb8326ce847 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.LinqService).sql index d4ffdc8dc695..020d02a7eca2 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.LinqService).sql index 8cc0f3eb5eb2..cada9411291d 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.LinqService).sql index 64cc0edd42f5..8e8d6cf9fba0 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.LinqService).sql index 70115c1ef7bb..6cbb22388aae 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.LinqService).sql index 70115c1ef7bb..6cbb22388aae 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.LinqService).sql index 7a4d576cc516..989b7f59d91c 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.LinqService).sql index 44f61fb9ff9f..74c4366c2f9b 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.LinqService).sql index 3b82196b3a28..9a10ebf30f8c 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.LinqService).sql index cd4aab1e9cd2..f0aadb448624 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.LinqService).sql index 624c31068423..1361c22d0a7c 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.LinqService).sql index 624c31068423..1361c22d0a7c 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.LinqService).sql index d2b009a94359..6ccc315efcfb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.LinqService).sql index d2b009a94359..6ccc315efcfb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.LinqService).sql index 304a409f2c36..cce005ca7651 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2019.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.LinqService).sql index 0102af491a78..89f2d11fd21f 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..f89f4da8cc7a --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.LinqService).sql index 31d66ce4120b..081a22ca7202 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.LinqService).sql index b581a32fc0a4..4e1cd3f355fe 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.LinqService).sql index cf750107c67f..8d860d49b02c 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.LinqService).sql index 2d707cc6e069..05163fd07b9c 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2019 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.LinqService).sql index b3d158bfb56f..64b21c2cf0eb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.LinqService).sql index 9aa4ddbe3377..97f2edc3e830 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.LinqService).sql index b5cf24df436c..33a0bf27ca35 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.LinqService).sql index ad118b23de2a..abc323fbc497 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.LinqService).sql index 8cde4f83d659..925e5ceb208b 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.LinqService).sql index acc780e10510..a95275dde0c0 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2019 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.LinqService).sql index aea6a906b2e5..cfe82b030a94 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.LinqService).sql index b13b7ae42dbf..d02fb883fb00 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.LinqService).sql index c5ed6794258f..b8d1b0a82457 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.LinqService).sql index 31ffe123da0c..93616a1f760d 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.LinqService).sql index e3d3241f622e..7e2bb0cea2da 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.LinqService).sql index 2427ad96dd87..5c02bf259f05 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.LinqService).sql index 18ad3624f749..75b710a51c8e 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.LinqService).sql index 131ac2840829..40f2c94485ec 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,1).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,1).sql index c2adfc053a42..85e7009976c4 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,2).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,2).sql index c2adfc053a42..85e7009976c4 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,1).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,1).sql index 18ad3624f749..75b710a51c8e 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,1).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,2).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,2).sql index 18ad3624f749..75b710a51c8e 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,2).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.LinqService).sql index 2e97abb39203..65984f0ecf5b 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.LinqService).sql index 18ad3624f749..75b710a51c8e 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.LinqService).sql index 131ac2840829..40f2c94485ec 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.LinqService).sql index 899a7c65197b..d9eefc4f3bfe 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.LinqService).sql index 8fa2e402296f..4b703cbfae99 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.LinqService).sql index 2427ad96dd87..5c02bf259f05 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.LinqService).sql index 2e97abb39203..65984f0ecf5b 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.LinqService).sql index 15f321e4e06f..5734d9d09e11 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.LinqService).sql index 3bf0f9c143f1..048b9584ae76 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.LinqService).sql index 3bf0f9c143f1..048b9584ae76 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.LinqService).sql index 438d0e2768d2..78da814aa967 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.LinqService).sql index 438d0e2768d2..78da814aa967 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.LinqService).sql index 7290134111d1..0f828972d6c3 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2019.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.LinqService).sql index 6d5284a04162..2e27a19bb7cb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..f86b344e44a6 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..6e9364a1f3ca --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..c0a8bb17ecbe --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..c8fe4c665077 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..13266cbf9552 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..13266cbf9552 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..a2bc1ebf8003 --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.LinqService).sql new file mode 100644 index 000000000000..b23223f094fc --- /dev/null +++ b/SqlServer.2019.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.LinqService).sql index 3b063c8f4e6a..5c8bb91fbbf9 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.LinqService).sql index 3fade22f535f..16b8e2089b96 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.LinqService).sql index 3f4776704ca3..f56ab10550bf 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2019.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2019.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 23532f8d4fd5..95095a16f8ef 100644 --- a/SqlServer.2019.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2019.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.LinqService).sql index 2a9a6349bda1..aa17cbddda1e 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.LinqService).sql index 60fc78bd72c1..72ac3fba0f20 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.LinqService).sql index 6ec493c0a166..50e2b4123b19 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.LinqService).sql index e68c1a408f6d..5c82276d6aae 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.LinqService).sql index 2beb3206d193..c85824264adc 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.LinqService).sql index f892e3e489b8..bcf6475d9f34 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.LinqService).sql index 484bcb4a62b9..bcd321be3bd6 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.LinqService).sql index 7e9566fdb490..07d1aded9819 100644 --- a/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.LinqService).sql index 42e01e37e5ca..63177b2a7af6 100644 --- a/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.LinqService).sql index 42e01e37e5ca..63177b2a7af6 100644 --- a/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2019.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..707f9ac8cf45 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2019.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..61614a022c15 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS.LinqService).sql index c3d4400194e6..217793552748 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS.LinqService).sql index c30c28f34178..d15ff1713a6a 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS.LinqService,False).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS.LinqService,False).sql index 12c34c942ede..ec7a86802887 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS.LinqService,False).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS.LinqService).sql index 2da0c09bacf3..654cfe85e81b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS.LinqService).sql index 70ee0db4c7d4..8a0fbde052ff 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS.LinqService).sql index 8c7ffa0dbeff..d9208f928acc 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS.LinqService).sql index 85ce51a04a6d..ceab5b16ec07 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS.LinqService).sql index 03fcc87189f2..76a13bf60da9 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS.LinqService).sql index 03fcc87189f2..76a13bf60da9 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS.LinqService).sql index 1626ab3925e6..bdd26df00764 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS.LinqService).sql index 42b7a13d9ccf..642aab8db85b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS.LinqService).sql index eea98f459a51..af189c785519 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS.LinqService).sql index 9be82c072235..1651e0968fb9 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS.LinqService).sql index dc5b3844c2c0..752a7c88899f 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS.LinqService).sql index dc5b3844c2c0..752a7c88899f 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS.LinqService).sql index 188207294dad..381d145d1852 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS.LinqService).sql index 188207294dad..381d145d1852 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS.LinqService).sql index 77f5176dd707..7962d4efa998 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS.LinqService).sql index 5363dd6c6206..135c73a5c0c8 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..8f040aa53d93 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS.LinqService).sql index a191fe4559f9..8c9398544983 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS.LinqService).sql index 9c1631a15db1..d6044e84e7f0 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS.LinqService).sql index 45b19da8716f..5979c892b242 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS.LinqService).sql index 64522489bb06..38bf1797015c 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS.LinqService).sql index 126b95949350..c6743b0565a4 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS.LinqService).sql index 3ff29af6ad6a..b5a27a5db431 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS.LinqService).sql index bccf1114e124..e0f88e8e34d3 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS.LinqService).sql index 6c005d362cca..65d39102a4e4 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS.LinqService).sql index 681e380bd712..15fd726114a4 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS.LinqService).sql index a1971196dbcb..b2cfd799d8d3 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS.LinqService).sql index 20e0f2cf93c0..c8a130384235 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS.LinqService).sql index 68474b92f128..9995ed41cec6 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS.LinqService).sql index 7abf363e6b3c..c5d10fab463e 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS.LinqService).sql index 83ed54f30670..04e7163a2fb4 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS.LinqService).sql index b100005502f4..a44fb8139dbb 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS.LinqService).sql index fb6f35980b2e..fd522bba41e3 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS.LinqService).sql index 6afeaba19cdc..3911b019fe61 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS.LinqService).sql index 067cea835680..3fbe9a8b2c56 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,1).sql index 1e177e2977cf..07488977cff8 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,2).sql index 1e177e2977cf..07488977cff8 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,1).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,1).sql index 6afeaba19cdc..3911b019fe61 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,2).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,2).sql index 6afeaba19cdc..3911b019fe61 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS.LinqService).sql index b31b800ec518..971e66f2fb4b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS.LinqService).sql index 6afeaba19cdc..3911b019fe61 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS.LinqService).sql index 067cea835680..3fbe9a8b2c56 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS.LinqService).sql index 1baae29fa022..a7462292a428 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS.LinqService).sql index b13663c8102b..fb5d5b76af89 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS.LinqService).sql index fb6f35980b2e..fd522bba41e3 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS.LinqService).sql index b31b800ec518..971e66f2fb4b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS.LinqService).sql index e6fd405374c4..df453e7b8a16 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS.LinqService).sql index 73fafc3676a5..07a381c510a8 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS.LinqService).sql index 73fafc3676a5..07a381c510a8 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS.LinqService).sql index 1932cee2b40d..0b8c2bceaa42 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS.LinqService).sql index 1932cee2b40d..0b8c2bceaa42 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS.LinqService).sql index 82f5bf86af38..7e4be5eb9e27 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS.LinqService).sql index 182cee0939a6..64d9c6f3981a 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..6cc6dc0faa03 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..d1cf1616b257 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..69deb276eb45 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..63fb2a0ebdca --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..732299e380a3 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..732299e380a3 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..7a52bf27bda5 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.MS.LinqService).sql new file mode 100644 index 000000000000..396c3a8b0256 --- /dev/null +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.MS.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS.LinqService).sql index 08947eefa59c..6d5523c580a6 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS.LinqService).sql index c698220f4a00..52aa1273743f 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS.LinqService).sql index 213ff5f69c5e..aee0aff4ffa0 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2019.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2019.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 4b57718baa89..f3ea1ceb9f2d 100644 --- a/SqlServer.2019.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2019.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS.LinqService).sql index 55af09b637e5..bf17461b7588 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS.LinqService).sql index 9a60c89df7dd..4c5f33ae4663 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS.LinqService).sql index 084b9e91201b..b62bf8456233 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS.LinqService).sql index e26e4fd96443..4ec2c43559e4 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS.LinqService).sql index 78120e40843c..c4ded180e137 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS.LinqService).sql index 9ac3cbe75966..7cdb87993638 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS.LinqService).sql index 00140a35682e..d08b64e8013b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS.LinqService).sql index 319a98e26f12..98d5efefbe37 100644 --- a/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS.LinqService).sql index fedc1ce37ed1..4fd5a6ed889b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS.LinqService).sql index fedc1ce37ed1..4fd5a6ed889b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019.MS).sql index e079aee55f82..7e44d0b2b390 100644 --- a/SqlServer.2019.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..daa147905a5d --- /dev/null +++ b/SqlServer.2019.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2019.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..b3d1715693bb --- /dev/null +++ b/SqlServer.2019.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2019.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS).sql index 3c07d6302d6e..1bdf8dea645c 100644 --- a/SqlServer.2019.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019.MS).sql index 2456768ceb1d..1074d5367c64 100644 --- a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019.MS).sql index 2456768ceb1d..1074d5367c64 100644 --- a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019.MS).sql index 742fb87aab2a..69dfb44d714c 100644 --- a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2019.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS).sql index 45d39cdc0b71..cde74c214090 100644 --- a/SqlServer.2019.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2019.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS,False).sql index ced07dc670de..e14c1b02391f 100644 --- a/SqlServer.2019.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS,False).sql +++ b/SqlServer.2019.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2019.MS SqlServer.2019 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2019.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS).sql index 23ad316231ce..4418414ce876 100644 --- a/SqlServer.2019.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS).sql index efd3960b4a14..2633ca4316d4 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS).sql index a28779d075d3..dd4ceb4aa28b 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS).sql index 9008bc474e5d..07c1bd9c00e9 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS).sql index 1072244f3aad..13331fda1160 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS).sql index 1072244f3aad..13331fda1160 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS).sql index 8d77b762a573..87bb1ede8f75 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS).sql index 8f9412cc82b7..c386961f7227 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS).sql index b373623b81f7..69df95ae067c 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS).sql index 09dadff88b92..d7f433170ef4 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS).sql index 0e7cf190cc1c..823e92fd63fa 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS).sql index 0e7cf190cc1c..823e92fd63fa 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS).sql index 547a456c1b59..2fc235c1f406 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS).sql index 188207294dad..381d145d1852 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS).sql index 452358cea3b4..9abfb947cc0a 100644 --- a/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2019.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS).sql index df592baad08e..6fbd3f23c670 100644 --- a/SqlServer.2019.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2019.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..ac82709445e7 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS).sql index baf34b6e2d18..e3f8da0d685a 100644 --- a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS).sql index 0d4bc88f81c8..ddb6becfae0e 100644 --- a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS).sql index d9995e253066..c82d8335115e 100644 --- a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS).sql index 991c19b0796f..2d8294e66bcc 100644 --- a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS).sql index 9708bf376bc5..e0a6ab6ce1cb 100644 --- a/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019.MS).sql index 5d30be1c2068..0adbaa42f8a2 100644 --- a/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019.MS).sql index 08c4863f6308..2aa7065883ad 100644 --- a/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019.MS).sql index 91e744bbfb95..40adaac5c9c2 100644 --- a/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS).sql index 3993cf624e85..8f1837175d60 100644 --- a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS).sql index 2347a355283e..d9ad6c3cdf89 100644 --- a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS).sql index 42ad27840da2..13e7f68f18e5 100644 --- a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS).sql index 975998a8948e..22f07f5f3f08 100644 --- a/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS).sql index 2c77d8507649..604e64841cb4 100644 --- a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2019.MS SqlServer.2019 diff --git a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS).sql index 23385b371137..a138f36c7258 100644 --- a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS).sql index d2acf953827a..7cbd057416b9 100644 --- a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS).sql index 26342987f5f7..c48da8b8d65d 100644 --- a/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS).sql index 0e8e7f4649e0..5aac95701bd9 100644 --- a/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS).sql index 0de05e7a443e..8ba3810d1a35 100644 --- a/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS).sql index 1ecf72105714..4eaa54542e49 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS).sql index 3becd013d63b..2d0d66a3b455 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS).sql index 981c4d5c799a..661cd2b9e7df 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,1).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,1).sql index a202f3910cf0..51f9b9f0862f 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,1).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,2).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,2).sql index a202f3910cf0..51f9b9f0862f 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,2).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,1).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,1).sql index 3becd013d63b..2d0d66a3b455 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,1).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,2).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,2).sql index 3becd013d63b..2d0d66a3b455 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,2).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS).sql index df1c270229ba..d555b072cd2c 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS).sql index 3becd013d63b..2d0d66a3b455 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS).sql index 981c4d5c799a..661cd2b9e7df 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS).sql index d28b485c2d58..70bb399ca5ee 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS).sql index 23a2e7d94e37..be8d6530ae4d 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS).sql index 1ecf72105714..4eaa54542e49 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS).sql index df1c270229ba..d555b072cd2c 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS).sql index 2f91c752ba3a..931a022cca7a 100644 --- a/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS).sql index db31c04f268e..d1c1707dfc05 100644 --- a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS).sql index db31c04f268e..d1c1707dfc05 100644 --- a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS).sql index 450fb9af6a0a..a86bd437aac9 100644 --- a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS).sql index 450fb9af6a0a..a86bd437aac9 100644 --- a/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS).sql index c87c409aec33..5fc5d97bebb5 100644 --- a/SqlServer.2019.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2019.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS).sql index 17e6097fd7b8..f6b2f97e04b7 100644 --- a/SqlServer.2019.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2019.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.MS).sql index 12299f58b6b5..131ffba0f2b7 100644 --- a/SqlServer.2019.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2019.MS SqlServer.2019 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..c9f7aaccf1e0 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019.MS).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..df33a3c2b9be --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019.MS).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..16d6e1106589 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..732299e380a3 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..ce3d5a855455 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..e3fa482c2660 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019.MS).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..640b1db6cf66 --- /dev/null +++ b/SqlServer.2019.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019.MS).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS).sql index 571d64fc9632..e07df2ed6190 100644 --- a/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS).sql index 6a1d5552baed..1fae26f3fad3 100644 --- a/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS).sql index 7c5adeb5cdaa..c4f6bd372bad 100644 --- a/SqlServer.2019.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2019.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2019.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 75dbf204ad8c..dd7b1b468a0d 100644 --- a/SqlServer.2019.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2019.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS).sql index f5c72a537598..b1c99bd58f12 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS).sql index c1318d1a589c..fd7fe8062b87 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS).sql index f1ee23d472aa..a27294cd294e 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019.MS).sql index f1ee23d472aa..a27294cd294e 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS).sql index fc2b828b42a3..1047245bae72 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019.MS).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019.MS).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019.MS).sql index b5a3f8684177..fb191d8e07db 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019.MS).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS).sql index 1135058db7ee..b39eb295e230 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019.MS).sql index 98c43fdbf81a..dbdd7c7cb4d4 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS).sql index a7608007c521..cdfb4d23634e 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS).sql index c425c447d2df..ec0c3bf38bf8 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS).sql index 816746a43744..e58a8d85fd6f 100644 --- a/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019.MS).sql index 624c1cb22138..b6c573567cab 100644 --- a/SqlServer.2019.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2019.MS SqlServer.2019 diff --git a/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS).sql index 748e68863dc1..2dccfbb66685 100644 --- a/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS).sql index 748e68863dc1..2dccfbb66685 100644 --- a/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019).sql b/SqlServer.2019/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019).sql index cee714d6bbea..7d82104a1b3b 100644 --- a/SqlServer.2019/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2019).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019).sql b/SqlServer.2019/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019).sql new file mode 100644 index 000000000000..6338e7179796 --- /dev/null +++ b/SqlServer.2019/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2019).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2019/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019).sql b/SqlServer.2019/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019).sql new file mode 100644 index 000000000000..c749dffec42c --- /dev/null +++ b/SqlServer.2019/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2019).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2019/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019).sql b/SqlServer.2019/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019).sql index 6c0219276ec8..99e06525bbee 100644 --- a/SqlServer.2019/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2019).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019).sql index cc2b7b30ff97..8af3b437ba2f 100644 --- a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2019).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019).sql index cc2b7b30ff97..8af3b437ba2f 100644 --- a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2019).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019).sql index 263b785faa05..b691af2f5f64 100644 --- a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2019).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2019/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019).sql index c7f2e4cea0c9..e94ff0773a3e 100644 --- a/SqlServer.2019/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2019).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2019/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019,False).sql b/SqlServer.2019/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019,False).sql index c97f7990bbb6..1e4dc2c4ae40 100644 --- a/SqlServer.2019/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019,False).sql +++ b/SqlServer.2019/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2019,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2019 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2019 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2019/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019).sql index c323ac004dac..b681a1a2e7d1 100644 --- a/SqlServer.2019/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019).sql index 222acb96b3d4..e537f295ff9b 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2019).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019).sql index 120201c2e134..3072a50552d9 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2019).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019).sql index 564c85a48f05..874636a6645f 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2019).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019).sql index babf2885156b..dd8fcd83d463 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2019).sql @@ -2,16 +2,16 @@ -- SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019).sql index babf2885156b..dd8fcd83d463 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2019).sql @@ -2,16 +2,16 @@ -- SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019).sql index ed9b79c2c39c..48eabc0c96bb 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2019).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019).sql index cfcba74a85f2..45812df6ef50 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2019).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019).sql index 4338ed00687b..8bbaf3986af5 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2019).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019).sql index 8f0bbd32a484..d1fb10295567 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019).sql index 105f62db680c..e90f2ccb01e1 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2019).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019).sql index 105f62db680c..e90f2ccb01e1 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2019).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019).sql index 7f13e2d9cc6f..0cc53df5164b 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2019).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019).sql index d2b009a94359..6ccc315efcfb 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2019).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019).sql index 90fe20df1c29..28340ec2784b 100644 --- a/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2019).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2019/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019).sql index 23a54bfcf57d..cb0a277375df 100644 --- a/SqlServer.2019/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2019).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2019/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019).sql new file mode 100644 index 000000000000..866f792043c8 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2019).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019).sql index 230e8bd9a03d..97d582147a5b 100644 --- a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2019).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019).sql index cfcb4e917b9e..af55a7b1109a 100644 --- a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2019).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019).sql index 3fb921ba9197..6d1c9c6b9b83 100644 --- a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2019).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019).sql index 5dc31bae0326..4c1b81ddab4e 100644 --- a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2019).sql @@ -2,13 +2,13 @@ -- SqlServer.2019 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019).sql index ae6f1cf09397..51a62ca56ffa 100644 --- a/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2019).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019).sql index 03914b052508..ca18feab743a 100644 --- a/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2019).sql @@ -2,7 +2,6 @@ -- SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019).sql index bf55bf1dbdcc..a9e8f0f6308d 100644 --- a/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2019).sql @@ -2,7 +2,6 @@ -- SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019).sql index c3f289e72c55..a78046b9bdd8 100644 --- a/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2019).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019).sql index c0f22fc18c37..621b81b5658f 100644 --- a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2019).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019).sql index 10e15b345408..3ae30a22c331 100644 --- a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2019).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019).sql index 31951a8f1c66..8b9f0c2ba497 100644 --- a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2019).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019).sql index 46a4929ce9af..886bc24f09ac 100644 --- a/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2019).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019).sql index 0e595ad5ff32..228fec14f82d 100644 --- a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2019).sql @@ -2,87 +2,23 @@ -- SqlServer.2019 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2019 diff --git a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019).sql index 909c3141cfde..17c866682364 100644 --- a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2019).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019).sql index e3f647186821..94d556089d19 100644 --- a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2019).sql @@ -2,17 +2,17 @@ -- SqlServer.2019 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019).sql index 09286aa9b467..349b45ef327a 100644 --- a/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2019).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019).sql index 9257bf3e492b..e011ea3900db 100644 --- a/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2019).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019).sql index 68f6c84e5282..b874898d50dc 100644 --- a/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2019).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019).sql index f18e568a2ca3..4ca1647cc771 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019).sql index 0a51c109b6db..72a95d967905 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2019).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019).sql index 72fc96a83f23..e996bf121cce 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,1).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,1).sql index 9c5b9af500f3..7476f1d8eb0e 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,1).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,2).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,2).sql index 9c5b9af500f3..7476f1d8eb0e 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,2).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,1).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,1).sql index 0a51c109b6db..72a95d967905 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,1).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,2).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,2).sql index 0a51c109b6db..72a95d967905 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,2).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2019,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019).sql index 37fedd2896c9..ff34450e881e 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019).sql index 0a51c109b6db..72a95d967905 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2019).sql @@ -2,12 +2,11 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019).sql index 72fc96a83f23..e996bf121cce 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019).sql index db9b7bedc0ca..d522d77fae5a 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019).sql index 0018109eef6a..835721f06537 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019).sql index f18e568a2ca3..4ca1647cc771 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019).sql index 37fedd2896c9..ff34450e881e 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019).sql index bdd65b40d216..7bca89c44db1 100644 --- a/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2019).sql @@ -2,9 +2,14 @@ -- SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019).sql index f2f5f6d33788..c9ee308fa5e3 100644 --- a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2019).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019).sql index f2f5f6d33788..c9ee308fa5e3 100644 --- a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2019).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019).sql index 393778361eba..1f220fd91ecb 100644 --- a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2019).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019).sql index 393778361eba..1f220fd91ecb 100644 --- a/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2019).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2019/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019).sql index 292ccef97f2c..7a8c10aad46d 100644 --- a/SqlServer.2019/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2019).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2019/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019).sql index 36ac32850585..f13273bcee75 100644 --- a/SqlServer.2019/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2019).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2019/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019).sql index 6365a2f0a0ee..679f438c3050 100644 --- a/SqlServer.2019/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2019 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2019 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019).sql new file mode 100644 index 000000000000..e508191fcb09 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2019).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019).sql new file mode 100644 index 000000000000..93170a0f9a91 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2019).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019).sql new file mode 100644 index 000000000000..a1e1e3c28adc --- /dev/null +++ b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2019).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019).sql new file mode 100644 index 000000000000..13266cbf9552 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2019).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019).sql new file mode 100644 index 000000000000..20d488bf9aac --- /dev/null +++ b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2019).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019).sql new file mode 100644 index 000000000000..096e235af486 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2019).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019).sql new file mode 100644 index 000000000000..cc7d625b7205 --- /dev/null +++ b/SqlServer.2019/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2019).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019).sql index 2a43012bd946..66e62aecc147 100644 --- a/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2019).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019).sql index 41578ac57d28..923e89df17aa 100644 --- a/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2019).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019).sql index 77df58379a61..cc129e49da35 100644 --- a/SqlServer.2019/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2019).sql @@ -2,12 +2,12 @@ -- SqlServer.2019 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2019/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2019/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 51c036f26418..bf8a5f4931f9 100644 --- a/SqlServer.2019/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2019/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2019,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019).sql index 6a8983d8d9e8..1668db77106d 100644 --- a/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2019).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019).sql index fcbe732f4d52..bc31b970ade7 100644 --- a/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2019).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019).sql index dafdd2773a10..a6823db1e8ad 100644 --- a/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2019).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019).sql index dafdd2773a10..a6823db1e8ad 100644 --- a/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2019).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019).sql index ae396ad3d8ad..f2640bfcc3f0 100644 --- a/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2019).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2019).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2019).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2019/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019).sql index ed28940bfc10..b7b2b80383ff 100644 --- a/SqlServer.2019/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2019).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2019/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019).sql index 104fc23bfcd2..24d7792b331c 100644 --- a/SqlServer.2019/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2019).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2019/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019).sql index dbf81e69c97e..202e9326f447 100644 --- a/SqlServer.2019/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2019).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2019/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019).sql index 3c252834c49a..cc11b7d67705 100644 --- a/SqlServer.2019/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2019).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019).sql index 6b07024d8155..58a2ecf46545 100644 --- a/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2019).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019).sql index 4807ccffce47..e7adbf0deb71 100644 --- a/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2019).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2019/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019).sql index 7d23291f99e1..c412c95d46c8 100644 --- a/SqlServer.2019/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2019).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2019 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2019 diff --git a/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019).sql b/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019).sql index 2c6ec3723faf..a2e0a883eeb5 100644 --- a/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2019).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019).sql b/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019).sql index 2c6ec3723faf..a2e0a883eeb5 100644 --- a/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2019).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..f21521d02878 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2022.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..03d118c2b066 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2022.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.LinqService).sql index 78f2544c0938..e86d14df79a4 100644 --- a/SqlServer.2022.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2022.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.LinqService).sql index 5f4f61718c3f..ba5c8ccbe77c 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2022.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.LinqService,False).sql b/SqlServer.2022.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.LinqService,False).sql index 48edfe525959..c1bb9dbec67d 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.LinqService,False).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2022 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2022 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2022.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.LinqService).sql index e71e2f480c68..296a66f927a3 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.LinqService).sql index d08bb4e09152..08ecf659ede8 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.LinqService).sql index e8d3269a66e4..06ece0fc32e6 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.LinqService).sql index ef9fc309126a..aaebec17320e 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.LinqService).sql index 681f5eca2c07..593718efebe8 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.LinqService).sql index 681f5eca2c07..593718efebe8 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.LinqService).sql index db8816f4a002..6bb429911e3a 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.LinqService).sql index 3adf525e6c78..8baade35bb9e 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.LinqService).sql index 846cb9fc91e0..8b7295c1b4f5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.LinqService).sql index 5dc39c0299ab..35deb65b31c0 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.LinqService).sql index 6a4a61c08452..6b9394ef3736 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.LinqService).sql index 6a4a61c08452..6b9394ef3736 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.LinqService).sql index 5d0f2c6b6ffc..f77384bd925c 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.LinqService).sql index 5d0f2c6b6ffc..f77384bd925c 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.LinqService).sql index ca9c77fbb231..3eb0cec6fd51 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2022.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.LinqService).sql index 83020da08342..560456a7f65a 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..b9e961798b59 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.LinqService).sql index d6a17f639cb6..a6eb255511ab 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.LinqService).sql index 366be8618f0e..1f4c4c94dcb4 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.LinqService).sql index baf1d4aab644..569fdb4155b1 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.LinqService).sql index 159dffe87972..9ecd8ab98b1d 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2022 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.LinqService).sql index e2e893857b14..ea4a9c80fee5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.LinqService).sql index c0a2c353e804..0b5376de9923 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.LinqService).sql index e2aa75559924..aaff83abe376 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.LinqService).sql index b62035cc5ba0..b4613851cab1 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.LinqService).sql index 65fd11ccaacf..33f89d3db002 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.LinqService).sql index 158489cc728f..3c6a215a3bd6 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2022 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.LinqService).sql index 7ca72743376f..60f304fb4994 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.LinqService).sql index 81013c274b52..d1bae875177f 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.LinqService).sql index 59a92619f7ca..179e7d0d04f3 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.LinqService).sql index 8afbe473486d..ab25de4b9124 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.LinqService).sql index 35e2842ae614..ad4818cc9515 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.LinqService).sql index 4b321b60bce4..566a61807be3 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.LinqService).sql index fb87445176c4..08dd1cd0379b 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.LinqService).sql index ba5c16f75b33..bb8ba518b726 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,1).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,1).sql index 2b033dc9df54..8d378ec966b8 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,2).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,2).sql index 2b033dc9df54..8d378ec966b8 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,1).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,1).sql index fb87445176c4..08dd1cd0379b 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,1).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,2).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,2).sql index fb87445176c4..08dd1cd0379b 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,2).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.LinqService).sql index 7cae87912485..98d531e4bb63 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.LinqService).sql index fb87445176c4..08dd1cd0379b 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.LinqService).sql index ba5c16f75b33..bb8ba518b726 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.LinqService).sql index f19515b4f28d..157824768842 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.LinqService).sql index b6501110af62..d90824033306 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.LinqService).sql index 4b321b60bce4..566a61807be3 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.LinqService).sql index 7cae87912485..98d531e4bb63 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.LinqService).sql index f2b16745b20e..9e857956b203 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.LinqService).sql index c1545edce0a7..587b669fa518 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.LinqService).sql index c1545edce0a7..587b669fa518 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.LinqService).sql index 8ca39341e4c3..5bfd36fb4f52 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.LinqService).sql index 8ca39341e4c3..5bfd36fb4f52 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.LinqService).sql index 944ef5754cd3..9fe7ea691f53 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2022.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.LinqService).sql index 3d335a3b1d0f..49ad7e673325 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..b01fdfcc7a68 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..1df16a0357f4 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..bba4ed569636 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..6dcf5342b338 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..6231c45b880f --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..6231c45b880f --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..ab36ebadf902 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.LinqService).sql new file mode 100644 index 000000000000..38590ef5e1a5 --- /dev/null +++ b/SqlServer.2022.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.LinqService).sql index 8ce155872ba8..038e357958f2 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.LinqService).sql index 98edba705d67..19eae0efed6e 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.LinqService).sql index 76bc8d867c5e..a8eb56256e57 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2022.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2022.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index f04c8d025e58..8a380227dd18 100644 --- a/SqlServer.2022.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2022.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.LinqService).sql index 10706b007cbe..625f9456c7af 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.LinqService).sql index 8c7ee578b4a4..b373c2b8fb1f 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.LinqService).sql index 251097d2de29..cd6e1b5ba0cf 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.LinqService).sql index 8d5069190df9..a56daa99b56e 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.LinqService).sql index 690c11266652..cf7e80b81871 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.LinqService).sql index e057b825f9d7..7b1afc29d120 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.LinqService).sql index 96664c919dfa..70ec72ddb2c0 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.LinqService).sql index a681cbf3b5de..d77901cce154 100644 --- a/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.LinqService).sql index 7bfc475ff3d2..cbfbba79aea4 100644 --- a/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.LinqService).sql index 7bfc475ff3d2..cbfbba79aea4 100644 --- a/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql index d48d14eabf47..77bab85d3af0 100644 --- a/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql index c76c9a03b301..2fc3bb3f3558 100644 --- a/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql index d48d14eabf47..77bab85d3af0 100644 --- a/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql index c76c9a03b301..2fc3bb3f3558 100644 --- a/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql index d48d14eabf47..77bab85d3af0 100644 --- a/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql index c76c9a03b301..2fc3bb3f3558 100644 --- a/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2022.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..b0c61589ae86 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2022.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..ee28a5db363a --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS.LinqService).sql index f9dcb39e5a22..8ba36295d0cf 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS.LinqService).sql index f5b6bc79484c..8560fe6601dd 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS.LinqService,False).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS.LinqService,False).sql index 8702ea30198b..c5917d340631 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS.LinqService,False).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS.LinqService).sql index de59d2470136..4c950b5d96e8 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS.LinqService).sql index 19849bf8be1d..83aa94029d06 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS.LinqService).sql index 47965067f525..8406389a63e5 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS.LinqService).sql index f946f3e19666..ec050eecad21 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS.LinqService).sql index 6779904a16f6..8034c6199e30 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS.LinqService).sql index 6779904a16f6..8034c6199e30 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS.LinqService).sql index ffc82b909a02..471dd0b40a23 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS.LinqService).sql index 88188e349366..9a98a23684a6 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS.LinqService).sql index c628e899b618..b31caf01f297 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS.LinqService).sql index 07729c294ca5..e887806fc452 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS.LinqService).sql index d2423ab30521..89136b85c564 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS.LinqService).sql index d2423ab30521..89136b85c564 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS.LinqService).sql index c0ebe23287ac..04da847a8554 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS.LinqService).sql index c0ebe23287ac..04da847a8554 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS.LinqService).sql index 2926f315a4e8..1b735bb2d433 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS.LinqService).sql index ffe7528c1382..eb69b4567b33 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..819478b68369 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS.LinqService).sql index d3376c172749..886c03d73aaa 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS.LinqService).sql index 2cfbc335dfc7..aa4dfc877840 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS.LinqService).sql index e6500f784b9f..52db8e44248b 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS.LinqService).sql index 82547325e53d..d26183926b9d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS.LinqService).sql index 27fbc51701e8..2493faf09a66 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS.LinqService).sql index 9aa44b70cc80..e92815d8e8f1 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS.LinqService).sql index 2940ecf7236e..d691261d8bb5 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS.LinqService).sql index f1d3a4ad5600..c74aeb2e1715 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS.LinqService).sql index fe8bbb70b072..c30a765f43c3 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS.LinqService).sql index fcb28e656cf9..f853ffe56562 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS.LinqService).sql index df69a0ed719e..6ced8d95f0d3 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS.LinqService).sql index 76298f5ee1aa..cd81ce48575a 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS.LinqService).sql index 1eaccb8bbc63..0ca88ab417e2 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS.LinqService).sql index f49cae6767bc..551d73948fbe 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS.LinqService).sql index 4a5186ba8c32..550d94c1712d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS.LinqService).sql index 4248abacbe49..7fbcbfbf1b14 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS.LinqService).sql index 77b9a562e89b..e7cfae406f5d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS.LinqService).sql index ef8df19be9e4..860262af4197 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,1).sql index c34529bf1af2..e4415d4d592d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,2).sql index c34529bf1af2..e4415d4d592d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,1).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,1).sql index 77b9a562e89b..e7cfae406f5d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,2).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,2).sql index 77b9a562e89b..e7cfae406f5d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS.LinqService).sql index 9e8b7c75eb83..776807a04500 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS.LinqService).sql index 77b9a562e89b..e7cfae406f5d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS.LinqService).sql index ef8df19be9e4..860262af4197 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS.LinqService).sql index 19eaeac03c29..a73f3b203c74 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS.LinqService).sql index 0170fe5f190d..e15c91a7bda9 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS.LinqService).sql index 4248abacbe49..7fbcbfbf1b14 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS.LinqService).sql index 9e8b7c75eb83..776807a04500 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS.LinqService).sql index 3045dd466194..2b7360e39d93 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS.LinqService).sql index c19116ecf75e..fc14aafc923f 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS.LinqService).sql index c19116ecf75e..fc14aafc923f 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS.LinqService).sql index ec4732086989..7c5efca5fb03 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS.LinqService).sql index ec4732086989..7c5efca5fb03 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS.LinqService).sql index 38ef56c077fa..93a569537073 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS.LinqService).sql index aba22762d604..bb575c9a131d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..d0bb8c8eed52 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..220d54388ea4 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..196c71b9c386 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..54150f22b6cf --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..2fa14ea04775 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..2fa14ea04775 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..734e2703f1b7 --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.MS.LinqService).sql new file mode 100644 index 000000000000..f8167351b99f --- /dev/null +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.MS.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS.LinqService).sql index 6124f9e6a34b..bde3dfd54bfc 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS.LinqService).sql index 35c074e1018e..eac82f5d6230 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS.LinqService).sql index 1625d88469fd..f97fb3c182a3 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2022.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2022.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 1bff69a395b1..021688dde25b 100644 --- a/SqlServer.2022.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2022.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 (asynchronously) diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS.LinqService).sql index bde185c9ef50..66f65c09c377 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS.LinqService).sql index cc7f22d26403..20fa85a0c214 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS.LinqService).sql index a26cf6d11978..9b01c0ff5d66 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS.LinqService).sql index 63cb729711bf..dc18b5dd04d2 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS.LinqService).sql index 4477dfd0d934..27958d1b92c8 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS.LinqService).sql index 9f1ba976208d..ad4a56a10da4 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS.LinqService).sql index fe29a7bfdac8..e73265a4b3ad 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS.LinqService).sql index e1d578d50b3f..ddec64bb0e46 100644 --- a/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS.LinqService).sql index bb1c60a0146c..e50b479f9083 100644 --- a/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS.LinqService).sql index bb1c60a0146c..e50b479f9083 100644 --- a/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022.MS).sql index b0db7f0cad3d..75a6adf750ed 100644 --- a/SqlServer.2022.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..0cb3b569d50f --- /dev/null +++ b/SqlServer.2022.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2022.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..74eda7487e44 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2022.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS).sql index 61cd6007bda2..13504ae8c4a6 100644 --- a/SqlServer.2022.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022.MS).sql index f4828a142a5b..e444ebd6a70c 100644 --- a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022.MS).sql index f4828a142a5b..e444ebd6a70c 100644 --- a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022.MS).sql index d7369ea4d453..1405b37bde95 100644 --- a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2022.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS).sql index 12b2f7dc6053..49fc01605ed5 100644 --- a/SqlServer.2022.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2022.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS,False).sql index a713a41c6530..997f326b2ad3 100644 --- a/SqlServer.2022.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS,False).sql +++ b/SqlServer.2022.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2022.MS SqlServer.2022 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2022.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS).sql index 38c5b94f7ecf..ff2fba193189 100644 --- a/SqlServer.2022.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS).sql index 2b64c02e097c..f6a365271265 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS).sql index fc25e65a7bf6..59b22607f3d9 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS).sql index d37e4b443008..8d3c9385c04e 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS).sql index b395174df0b2..486a8ae19b45 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS).sql index b395174df0b2..486a8ae19b45 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS).sql index 4409c2a54387..60b4228fdf81 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS).sql index 6f5c4cc1b01e..b81314590e92 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS).sql index e8a108293540..5046ee9bed43 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS).sql index 749550bb54f2..16c29797c7c2 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS).sql index 777cd71836ed..c3b7e8642f80 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS).sql index 777cd71836ed..c3b7e8642f80 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS).sql index 3ba4e6a68490..3d0482346e0c 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS).sql index c0ebe23287ac..04da847a8554 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS).sql index f3a29c9555be..2841a43d5b18 100644 --- a/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2022.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS).sql index ba2043314ca8..9c6b9869a2c2 100644 --- a/SqlServer.2022.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2022.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..aa9c3594acd0 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS).sql index 7b9e8a64f937..6f2a6c91f94c 100644 --- a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS).sql index fc7faa46e482..55fe042507cb 100644 --- a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS).sql index 4ed446986795..b75037c208a4 100644 --- a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS).sql index 96ab2f159381..b8fd7eb4dad2 100644 --- a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS).sql index dd2af9d34e77..453aca4cbc1b 100644 --- a/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022.MS).sql index 2ab5deb79566..b0ccba2d623e 100644 --- a/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022.MS).sql index 87da23fe8d89..28f3b60249c2 100644 --- a/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022.MS).sql index b04c20da2cf2..05b52138cf44 100644 --- a/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS).sql index e57d0fc04409..0ef375b663bb 100644 --- a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS).sql index ede61faf8b75..450f577ec264 100644 --- a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS).sql index 35daaa411018..2235c86bb0d8 100644 --- a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS).sql index f2e5dc4ee886..e8fad702b9b1 100644 --- a/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS).sql index 0cd78d226c1d..cde981e0f14f 100644 --- a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2022.MS SqlServer.2022 diff --git a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS).sql index ee213a52c9c9..6326152d855f 100644 --- a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS).sql index 76f46db667d3..7494882e2280 100644 --- a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS).sql index 7ffe8e53bf40..9eff4d090b22 100644 --- a/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS).sql index ff1f21ec53e3..fbe519634ecc 100644 --- a/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS).sql index f2d5d63fcc0c..95987ec35736 100644 --- a/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS).sql index f7c2232e56a8..4f566a2db846 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS).sql index 8debbd26988c..18c5341c1f03 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS).sql index fc92cb0eed25..18cdba05aa92 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,1).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,1).sql index 8b198685cf96..a617be19e011 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,1).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,2).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,2).sql index 8b198685cf96..a617be19e011 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,2).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,1).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,1).sql index 8debbd26988c..18c5341c1f03 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,1).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,2).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,2).sql index 8debbd26988c..18c5341c1f03 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,2).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS).sql index a554509af68d..894888ce7af1 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS).sql index 8debbd26988c..18c5341c1f03 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS).sql index fc92cb0eed25..18cdba05aa92 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS).sql index 4480c0f5089c..544ad3c1abe7 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS).sql index ebcbf182470f..d08ed38b7f2a 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS).sql index f7c2232e56a8..4f566a2db846 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS).sql index a554509af68d..894888ce7af1 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS).sql index 4039e2c6200c..d46df1329b7b 100644 --- a/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS).sql index d47f5f4c9a61..fd50b46cd063 100644 --- a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS).sql index d47f5f4c9a61..fd50b46cd063 100644 --- a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS).sql index ee33af22c6d6..fa2c585d908a 100644 --- a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS).sql index ee33af22c6d6..fa2c585d908a 100644 --- a/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS).sql index b50303aafdbd..ea21b2810004 100644 --- a/SqlServer.2022.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2022.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS).sql index 3dc43a48b83b..17c7637fd12e 100644 --- a/SqlServer.2022.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2022.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.MS).sql index 69e6cf6cc443..aa2dec28ace1 100644 --- a/SqlServer.2022.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2022.MS SqlServer.2022 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..bc2558973f1b --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022.MS).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..1442775d617f --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022.MS).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..25de9af712f9 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..2fa14ea04775 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..8a6536cbbf36 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..2e3dc87844b5 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022.MS).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..fb0c2cb8cda8 --- /dev/null +++ b/SqlServer.2022.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022.MS).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS).sql index 3fffa15b9c92..2f0ad86b4ae4 100644 --- a/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS).sql index d89099c40905..948c86418d15 100644 --- a/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS).sql index 3ecc416b16ae..c95534b871dd 100644 --- a/SqlServer.2022.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2022.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2022.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 282d11ef2992..5e4f9b2ae045 100644 --- a/SqlServer.2022.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2022.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS).sql index 54d7f2317842..5b0b5a28c3c8 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS).sql index db38724c0822..8fafd5fca1ab 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS).sql index d7d75c02358f..250ba40dd7f1 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022.MS).sql index d7d75c02358f..250ba40dd7f1 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS).sql index aba1af6318a3..0623db4eb3f1 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022.MS).sql index ec427d338f28..4a4ad32265f5 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022.MS).sql index ec427d338f28..4a4ad32265f5 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022.MS).sql index cd126b00fa21..76b4ee29ec68 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022.MS).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS).sql index 4ea9264a8443..4c5cfea66af4 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022.MS).sql index e635f795d2e5..20bc25e35256 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS).sql index 9b0f746b6375..17e139e97af5 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS).sql index 631fc5fb276b..ec0a50e2b528 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS).sql index 42db7ff47d10..6b0261f54fdb 100644 --- a/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022.MS).sql index eecebe853fef..f1186c66408d 100644 --- a/SqlServer.2022.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2022.MS SqlServer.2022 diff --git a/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS).sql index 550336b6d47c..eca647f80de1 100644 --- a/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS).sql index 550336b6d47c..eca647f80de1 100644 --- a/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022).sql b/SqlServer.2022/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022).sql index b3e3a3c26d33..2b04552fb1d7 100644 --- a/SqlServer.2022/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2022).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022).sql b/SqlServer.2022/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022).sql new file mode 100644 index 000000000000..4e5ada775959 --- /dev/null +++ b/SqlServer.2022/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2022).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2022/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022).sql b/SqlServer.2022/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022).sql new file mode 100644 index 000000000000..24c782b66ede --- /dev/null +++ b/SqlServer.2022/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2022).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2022/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022).sql b/SqlServer.2022/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022).sql index e9c78be4354b..de89b28705df 100644 --- a/SqlServer.2022/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2022).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022).sql index e759bd0649d3..538620ac05bd 100644 --- a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2022).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022).sql index e759bd0649d3..538620ac05bd 100644 --- a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2022).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022).sql index 1806d4e42e80..10f8e30208d3 100644 --- a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2022).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2022/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022).sql index 2d5530a1dd19..06ac398dd79f 100644 --- a/SqlServer.2022/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2022).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2022/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022,False).sql b/SqlServer.2022/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022,False).sql index 086318802721..4650e2ce17ca 100644 --- a/SqlServer.2022/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022,False).sql +++ b/SqlServer.2022/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2022,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2022 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2022 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2022/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022).sql index 91d956b56684..7cb823b0f42b 100644 --- a/SqlServer.2022/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022).sql index b8eee4b8dbc7..1ad6c8ee37f3 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2022).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022).sql index 08778e257a26..45d174e39e83 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2022).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022).sql index 03add3cb12fd..269c26c6132f 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2022).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022).sql index 847115da28d1..c555231a54b6 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2022).sql @@ -2,16 +2,16 @@ -- SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022).sql index 847115da28d1..c555231a54b6 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2022).sql @@ -2,16 +2,16 @@ -- SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022).sql index 75f213e10ac1..8aee15deae96 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2022).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022).sql index 05d732d83967..fbef4ce0d564 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2022).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022).sql index 132c09715a6e..3f809873e7b9 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2022).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022).sql index 654108a68d26..b91faf4b8a01 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022).sql index 637a3658674f..bcc55c7fb19a 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2022).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022).sql index 637a3658674f..bcc55c7fb19a 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2022).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022).sql index 3b42781bd00b..9f65dc517905 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2022).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022).sql index 5d0f2c6b6ffc..f77384bd925c 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2022).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022).sql index 69e27dc2694d..6dc36c30f03a 100644 --- a/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2022).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2022/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022).sql index b5b50fe5082b..3c4060a457a0 100644 --- a/SqlServer.2022/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2022).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2022/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022).sql new file mode 100644 index 000000000000..3651d0cb3fa6 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2022).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022).sql index 3da1949f1c89..930130ad50d6 100644 --- a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2022).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022).sql index 5a252784e8e5..7a31ae08ebd2 100644 --- a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2022).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022).sql index f8c6f20baa7c..91ce42b41884 100644 --- a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2022).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022).sql index 0ebb788142d8..2106431e28f0 100644 --- a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2022).sql @@ -2,13 +2,13 @@ -- SqlServer.2022 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022).sql index 05b7fad7ce5a..5f65697083f3 100644 --- a/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2022).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022).sql index 18bd48280a93..8df3d8468acb 100644 --- a/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2022).sql @@ -2,7 +2,6 @@ -- SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022).sql index 3229b6474c53..ebc723ebedfc 100644 --- a/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2022).sql @@ -2,7 +2,6 @@ -- SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022).sql index 32d4a0c03843..edc85dd82d95 100644 --- a/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2022).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022).sql index fd7f8679b27c..475dbdf5899d 100644 --- a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2022).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022).sql index e577043149cb..3ddef08a5619 100644 --- a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2022).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022).sql index 2cf5a5648a8d..8e353b691645 100644 --- a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2022).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022).sql index 6ee44a1941b7..66041cb46bff 100644 --- a/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2022).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022).sql index 61cd3458d4ae..dd4bfbf21fe4 100644 --- a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2022).sql @@ -2,87 +2,23 @@ -- SqlServer.2022 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2022 diff --git a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022).sql index 66a32552cb89..1a211884e282 100644 --- a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2022).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022).sql index c130322c4371..1592cc87418d 100644 --- a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2022).sql @@ -2,17 +2,17 @@ -- SqlServer.2022 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022).sql index b4240b6ff519..5bf7a9143fa9 100644 --- a/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2022).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022).sql index dc55db9e204b..797ffe44a7dd 100644 --- a/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2022).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022).sql index b87ebf2c9c0f..7deb1fe38bab 100644 --- a/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2022).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022).sql index 442827bfdf89..3e2b43ca4174 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022).sql index 578ca6f7ef14..b66272dddf8b 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2022).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022).sql index 4b1a0b5d94cd..8ed65a3c4cd8 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,1).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,1).sql index d2d28b2a7a34..70901818b03a 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,1).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,2).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,2).sql index d2d28b2a7a34..70901818b03a 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,2).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,1).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,1).sql index 578ca6f7ef14..b66272dddf8b 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,1).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,2).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,2).sql index 578ca6f7ef14..b66272dddf8b 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,2).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2022,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022).sql index 4a8990ce4380..ad5c3f0c4b2f 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022).sql index 578ca6f7ef14..b66272dddf8b 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2022).sql @@ -2,12 +2,11 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022).sql index 4b1a0b5d94cd..8ed65a3c4cd8 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022).sql index 2879820af77c..5ab3dff242bf 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022).sql index 6b9bd6858347..f709a1e78c23 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022).sql index 442827bfdf89..3e2b43ca4174 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022).sql index 4a8990ce4380..ad5c3f0c4b2f 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022).sql index e8b5ab9092dc..c01d05f4b3d5 100644 --- a/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2022).sql @@ -2,9 +2,14 @@ -- SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022).sql index 4c927182e67d..997a8baf3ba6 100644 --- a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2022).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022).sql index 4c927182e67d..997a8baf3ba6 100644 --- a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2022).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022).sql index 33fb2c88fc85..f7ca5e21cb5f 100644 --- a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2022).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022).sql index 33fb2c88fc85..f7ca5e21cb5f 100644 --- a/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2022).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2022/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022).sql index c52db975ccba..3e31f9fb9e01 100644 --- a/SqlServer.2022/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2022).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2022/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022).sql index 77c1b1a7f573..14eba76bbed4 100644 --- a/SqlServer.2022/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2022).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2022/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022).sql index 1904571aa1ce..b4d9b8a9be5b 100644 --- a/SqlServer.2022/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2022 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2022 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022).sql new file mode 100644 index 000000000000..e3a685d12ceb --- /dev/null +++ b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2022).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022).sql new file mode 100644 index 000000000000..fafb0c0f7d59 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2022).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022).sql new file mode 100644 index 000000000000..07ba6315cd39 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2022).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022).sql new file mode 100644 index 000000000000..6231c45b880f --- /dev/null +++ b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2022).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022).sql new file mode 100644 index 000000000000..2df81a54d5a2 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2022).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022).sql new file mode 100644 index 000000000000..49660c4e4ac5 --- /dev/null +++ b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2022).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022).sql new file mode 100644 index 000000000000..301e04e7187d --- /dev/null +++ b/SqlServer.2022/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2022).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022).sql index 429a757e7167..9d8483698d34 100644 --- a/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2022).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022).sql index bc520a5570ed..7544eaf6d357 100644 --- a/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2022).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022).sql index 8e4489aea6bb..5cd323b62399 100644 --- a/SqlServer.2022/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2022).sql @@ -2,12 +2,12 @@ -- SqlServer.2022 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2022/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2022/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 990a88059383..4a35cc8b279d 100644 --- a/SqlServer.2022/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2022/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2022,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022).sql index e671504fcdbb..b15d87a5b6b3 100644 --- a/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2022).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022).sql index f6978b2b74e3..7cbd81157688 100644 --- a/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2022).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022).sql index 5737c356b25a..459dab0d82f9 100644 --- a/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2022).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022).sql index 5737c356b25a..459dab0d82f9 100644 --- a/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2022).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022).sql index e18d5f739544..98274631f2b8 100644 --- a/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2022).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022).sql index ec427d338f28..4a4ad32265f5 100644 --- a/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2022).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022).sql index ec427d338f28..4a4ad32265f5 100644 --- a/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2022).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2022/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022).sql index f90414502d03..96760b887141 100644 --- a/SqlServer.2022/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2022).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2022/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022).sql index 0e967ca1ef7d..d7591c86f5db 100644 --- a/SqlServer.2022/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2022).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2022/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022).sql index 5ade81084d2a..fc5b6d3f17c5 100644 --- a/SqlServer.2022/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2022).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2022/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022).sql index c5100ef5e6ee..e5468cf66358 100644 --- a/SqlServer.2022/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2022).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022).sql index 69a32d7401b9..f9fc64d839c0 100644 --- a/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2022).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022).sql index 917b260c9008..70162da40dc9 100644 --- a/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2022).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2022/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022).sql index 25cc6aed6228..8d5e1c59e322 100644 --- a/SqlServer.2022/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2022).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2022 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2022 diff --git a/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022).sql b/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022).sql index a6b5c6924448..8ccb27aaa578 100644 --- a/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2022).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022).sql b/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022).sql index a6b5c6924448..8ccb27aaa578 100644 --- a/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2022).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..2d30761a875f --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2025.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..62bfd85d8b6c --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2025.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.LinqService).sql index f49dd9edc616..32583e3abd92 100644 --- a/SqlServer.2025.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2025.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.LinqService).sql index ee61b29dc354..9290758b73ee 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2025.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.LinqService,False).sql b/SqlServer.2025.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.LinqService,False).sql index 6b9ebcc1c05b..3be83a57a5a9 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.LinqService,False).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2025.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.LinqService).sql index e40c3a9506bd..d6bdb4a20c1f 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.LinqService).sql index 2ffee1a917e0..a7ccd44614b4 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.LinqService).sql index 41aaee00f0bb..d223485a750b 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.LinqService).sql index a8f9fdba8962..93cd93c6b910 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.LinqService).sql index d3debcf1e3d1..026be028e707 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.LinqService).sql index d3debcf1e3d1..026be028e707 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.LinqService).sql index 35f683d57733..607e4f67a11e 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.LinqService).sql index bb1bdf9f4442..63203f0a1ef9 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.LinqService).sql index e57a8b345315..a50eeee4ffd8 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.LinqService).sql index 3de1ab8bebcc..74958652e4ac 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.LinqService).sql index d74c921d9b59..55181991d1d6 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.LinqService).sql index d74c921d9b59..55181991d1d6 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.LinqService).sql index f1b4a82633fa..4c8a92d77af4 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.LinqService).sql index f1b4a82633fa..4c8a92d77af4 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.LinqService).sql index a32dec13d5d2..346e6091d20d 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2025.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.LinqService).sql index 1f3f374febd7..9269802cfadf 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..a67ebccbbdf0 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.LinqService).sql index a9107eb01b19..17782294d1b4 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.LinqService).sql index c5519b44b41f..aea56eea31e6 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.LinqService).sql index 1eb121c7d3d4..8ea1ab074204 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.LinqService).sql index 41f80d8fb1fe..d8bad0fc3408 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.LinqService).sql index 82591438358c..30187d060f8f 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.LinqService).sql index b7169b0a4761..08f442518b72 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.LinqService).sql index 8eb49f706e85..3bbbd806f560 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.LinqService).sql index e9c9929a2cd0..a013d0b972f0 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.LinqService).sql index 5386bc317708..7e9194d0aa7d 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.LinqService).sql index af51aa76f782..b576e7163eb4 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.LinqService).sql index bf7d0bfacb91..942d3c5f19db 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.LinqService).sql index fddb8c8fb6ec..f621097dc6c2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.LinqService).sql index 38f8115feedd..f0dc9ed78c52 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.LinqService).sql index 69bc99b607f5..bc4987da1ca6 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.LinqService).sql index a271147a7e48..33d1cf0d5df2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.LinqService).sql index e085345dfae4..ebfaacffdaf2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.LinqService).sql index 7ac803fea89b..a1b6fb9991f2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.LinqService).sql index e719c4aa6ded..f8a38e5486e9 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,1).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,1).sql index 9039df5ebb33..253c862cd640 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,2).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,2).sql index 9039df5ebb33..253c862cd640 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,1).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,1).sql index 7ac803fea89b..a1b6fb9991f2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,1).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,2).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,2).sql index 7ac803fea89b..a1b6fb9991f2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,2).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.LinqService).sql index bd39e5a16471..7b1ee24d635f 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.LinqService).sql index 7ac803fea89b..a1b6fb9991f2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.LinqService).sql index e719c4aa6ded..f8a38e5486e9 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.LinqService).sql index e04f475133d9..6f0d744e32bd 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.LinqService).sql index a7bc7d356919..da8ec988d4af 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.LinqService).sql index e085345dfae4..ebfaacffdaf2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.LinqService).sql index bd39e5a16471..7b1ee24d635f 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.LinqService).sql index 34c7ccd904fb..f2908fca18c6 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.LinqService).sql index 6d87625a2517..f99d3f90b81f 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.LinqService).sql index 6d87625a2517..f99d3f90b81f 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.LinqService).sql index 16f248dc8cb0..82768255e2c3 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.LinqService).sql index 16f248dc8cb0..82768255e2c3 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.LinqService).sql index c914c84c5729..d3f984d6d935 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2025.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.LinqService).sql index ecfe7f9d6911..48dd2edd9e6c 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..44671938371e --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..93d00a28eb68 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..73ac5aa286c3 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..ce2a2710c595 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..280400ce0668 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..280400ce0668 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..653a2a353425 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.LinqService).sql new file mode 100644 index 000000000000..cb95a2e4fdf6 --- /dev/null +++ b/SqlServer.2025.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.LinqService).sql index 80a072869ddb..b60bb2207631 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.LinqService).sql index 607ec1f89809..2a2d03cf51b2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.LinqService).sql index 7a0383d59e50..80040df0b1a1 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2025.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2025.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index de7849e78290..d44ee22cd8b4 100644 --- a/SqlServer.2025.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2025.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.LinqService).sql index 0617a320d71b..b1fb88163626 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.LinqService).sql index 88ed474fc6b2..f3233e7bd3a7 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.LinqService).sql index d31a536b4747..afce8149851a 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.LinqService).sql index 83d248bb7374..7cf06bc1f390 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.LinqService).sql index 86962460ee4c..2681481b4edd 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.LinqService).sql index 43d8aedf071e..5e375ca67d52 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.LinqService).sql index a8794a62f943..dd53d8f296c0 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.LinqService).sql index 8f26baeafba8..512af331b292 100644 --- a/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.LinqService).sql index d7ab7576ecf4..7257279a9593 100644 --- a/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.LinqService).sql index d7ab7576ecf4..7257279a9593 100644 --- a/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql index 0df0afb74323..e42856d3ae9b 100644 --- a/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql index dd23c1be82f4..44589ee210a6 100644 --- a/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql index 0df0afb74323..e42856d3ae9b 100644 --- a/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql index dd23c1be82f4..44589ee210a6 100644 --- a/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql index 0df0afb74323..e42856d3ae9b 100644 --- a/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql index dd23c1be82f4..44589ee210a6 100644 --- a/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.2025.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..cff4d1c0b16a --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2025.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..ff9e0be5a700 --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS.LinqService).sql index f4049e3313ff..5b0c0acb66e7 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS.LinqService).sql index 972ed7feb67d..1ec8e610c47b 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS.LinqService,False).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS.LinqService,False).sql index b028945ded44..e1825bd85be5 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS.LinqService,False).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS.LinqService).sql index 91190a58e9e6..483480ec50a8 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS.LinqService).sql index c63a5283e184..cb2f887b8823 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS.LinqService).sql index 84c4a0c459cd..cfafb92147b5 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS.LinqService).sql index eea3a26da06a..417aed9a93a9 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS.LinqService).sql index 27d2813fac7c..803c005ed8d8 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS.LinqService).sql index 27d2813fac7c..803c005ed8d8 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS.LinqService).sql index b69f55c478e8..14ecc5d607f5 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS.LinqService).sql index 09a65345f101..19f031cc3875 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS.LinqService).sql index 9174c656e5e4..7529de908f60 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS.LinqService).sql index f4ca8918d9bc..dc85530ec5fa 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS.LinqService).sql index 36ac81babe4e..01dc7b210126 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS.LinqService).sql index 36ac81babe4e..01dc7b210126 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS.LinqService).sql index d31373b202d6..0d33b04d5683 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS.LinqService).sql index d31373b202d6..0d33b04d5683 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS.LinqService).sql index 1ed6602bb810..0a970b519703 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS.LinqService).sql index 35e8de151771..04669337268f 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..fdbefe337adc --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS.LinqService).sql index d23f55586964..bb56557733b4 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS.LinqService).sql index 3739b0bf44bc..9486d3683ee7 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS.LinqService).sql index 39f4e6bcec25..c3240959ccfc 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS.LinqService).sql index dd615db2445f..3be96e10f2fd 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS.LinqService).sql index f595ca85f115..e8de75bcee69 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS.LinqService).sql index 47f529dc9a31..2e4cdb80cf0c 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS.LinqService).sql index 6aaee5f4fe92..256d69a15323 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS.LinqService).sql index 650ed141c93a..5b902352fec4 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS.LinqService).sql index 2c3a1b32857c..2deefc3b335a 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS.LinqService).sql index 8fe1a81e4134..b58092047e2d 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS.LinqService).sql index a16bcc64d137..ebe2ca3a1be1 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS.LinqService).sql index 119704bd9868..3ea8ffbca6d6 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS.LinqService).sql index 493983900d4b..1caedaf5b488 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS.LinqService).sql index 465126002403..cb03208ce823 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS.LinqService).sql index 03e3816ff80c..b743329c1afc 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS.LinqService).sql index c90ed8eee568..4c9f1c51b5cf 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS.LinqService).sql index 050f01e3877a..21e35b081fcb 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS.LinqService).sql index 167161692a4b..172bf1cc4a4d 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,1).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,1).sql index b1bce2ffbdbc..04a6270d4e8c 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,2).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,2).sql index b1bce2ffbdbc..04a6270d4e8c 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,1).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,1).sql index 050f01e3877a..21e35b081fcb 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,1).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,2).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,2).sql index 050f01e3877a..21e35b081fcb 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,2).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS.LinqService).sql index 5c93f0a28a66..58f756932617 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS.LinqService).sql index 050f01e3877a..21e35b081fcb 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS.LinqService).sql index 167161692a4b..172bf1cc4a4d 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS.LinqService).sql index e1bfaef43626..4c252bbaca75 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS.LinqService).sql index f51c7dc6d37f..175605ec7249 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS.LinqService).sql index c90ed8eee568..4c9f1c51b5cf 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS.LinqService).sql index 5c93f0a28a66..58f756932617 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS.LinqService).sql index 2b34967f1c02..422c75c8a597 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS.LinqService).sql index ad92e8f6e33c..13ce02e66199 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS.LinqService).sql index ad92e8f6e33c..13ce02e66199 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS.LinqService).sql index d24af17b42e9..2e6f502ff0da 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS.LinqService).sql index d24af17b42e9..2e6f502ff0da 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS.LinqService).sql index 8426450e4b24..77fe1c5a4810 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS.LinqService).sql index b1ce7940f04a..01d06aa4c369 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..29ff56ca4592 --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..94767fa38bbe --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..e06df1ee8450 --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..e0fda914c36e --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..56681c2cf16a --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..56681c2cf16a --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..8a97fc5dbd02 --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.MS.LinqService).sql new file mode 100644 index 000000000000..b4fabf7e3bc7 --- /dev/null +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.MS.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS.LinqService).sql index 70a9104da1ab..e622b6f010f0 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS.LinqService).sql index ffd635281823..86d5162013b7 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS.LinqService).sql index 0b65f15f7b65..2ed287ca8961 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2025.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2025.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index b095d270ccde..3e7b13ae8e9f 100644 --- a/SqlServer.2025.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2025.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS.LinqService).sql index 55fdcdfefde1..7d5e17338165 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS.LinqService).sql index 2ac086ffebe5..475c57bf528f 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS.LinqService).sql index 41178b083c4d..e603e2100ff7 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS.LinqService).sql index 8eb9dd9ce69f..5cd72aa5f4b2 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS.LinqService).sql index 1da0ee99c3a4..57f677fc074f 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS.LinqService).sql index d3f9b5963656..010d3b35a16d 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS.LinqService).sql index 3a894525a719..592b0acfa713 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS.LinqService).sql index b9de92707ed6..1f98b06a0d7a 100644 --- a/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS.LinqService).sql index 974bf639cc43..9761f8657ea8 100644 --- a/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS.LinqService).sql index 974bf639cc43..9761f8657ea8 100644 --- a/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025.MS).sql index 528ee3b16191..efb76eccc425 100644 --- a/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..aaa76192f0e3 --- /dev/null +++ b/SqlServer.2025.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2025.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..a976a8f22afd --- /dev/null +++ b/SqlServer.2025.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2025.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS).sql index 81121364b510..ab896737f35c 100644 --- a/SqlServer.2025.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025.MS).sql index 11f5de61c09f..2eac02f45ca4 100644 --- a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025.MS).sql index 11f5de61c09f..2eac02f45ca4 100644 --- a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025.MS).sql index 31885cd2c7a6..778d1804c4e7 100644 --- a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2025.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS).sql index f9e8577027ab..3bb2c2d6f510 100644 --- a/SqlServer.2025.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2025.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS,False).sql index 6d892f105007..dbc02d0da9d0 100644 --- a/SqlServer.2025.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS,False).sql +++ b/SqlServer.2025.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2025.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS).sql index 09169001540f..2b45284c96eb 100644 --- a/SqlServer.2025.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS).sql index 6a3ce8c12c39..46fc465b167a 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS).sql index c11adefe3295..4e2fc5560254 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS).sql index 89bf6c7d81b9..73ecd8f4735f 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS).sql index 746cea0ad643..6fee05f26ca3 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS).sql index 746cea0ad643..6fee05f26ca3 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS).sql index 6ed03e8f1cde..7cf7001592ae 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS).sql index 05dbf8518c13..12075a3485b4 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS).sql index 8f9bc370906c..d8aea44e3342 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS).sql index 22db3c8a3087..58163de16789 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS).sql index 5873e1121884..631e9ac2cdb1 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS).sql index 5873e1121884..631e9ac2cdb1 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS).sql index fcaa96949a0b..d92e542cb3a7 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS).sql index d31373b202d6..0d33b04d5683 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS).sql index 3690b5023b8e..8ea6cafee42d 100644 --- a/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2025.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS).sql index 35a2a90d789b..4ab356f12a0b 100644 --- a/SqlServer.2025.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2025.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..088abbca3837 --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS).sql index 889d167fe33f..58aa60a340d5 100644 --- a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS).sql index da8bdc226059..314ce4962689 100644 --- a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS).sql index 21524ff4d6b9..159d39f1dd56 100644 --- a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS).sql index 6116910577b4..f766020c6d1c 100644 --- a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS).sql index e1bdce89eee0..121b60c45586 100644 --- a/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025.MS).sql index 7bd39a084718..29e9aac90fd7 100644 --- a/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025.MS).sql index 7991232b1d50..09271524cf28 100644 --- a/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025.MS).sql index 1f086f3da2f2..2f343c0d88bf 100644 --- a/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS).sql index 2708576b2566..8b268a46ccda 100644 --- a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS).sql index 060488adb22a..9a4796a251b6 100644 --- a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS).sql index fba4af90dcfb..7cfba9fbd854 100644 --- a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS).sql index 52e2ad60dc7b..5d1779c048a7 100644 --- a/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS).sql index a5bf8dde02b5..bf9c946b0a67 100644 --- a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 diff --git a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS).sql index 83f0bd36c2c3..21ec3cdf8d4b 100644 --- a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS).sql index 1f55563f7140..5af6816a64ca 100644 --- a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS).sql index c122ed184a52..66c82f06d3b7 100644 --- a/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS).sql index db3d0017d16f..4a9edb3d4fe7 100644 --- a/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS).sql index d809a34c48af..51170fa826de 100644 --- a/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS).sql index f434bf248aed..b6970ef9585d 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS).sql index 9e777d576406..d33f2aee99c0 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS).sql index f4b7a13ec511..86a2e4f497d6 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,1).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,1).sql index c300e6c1f52c..cb5ed427aab8 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,1).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,2).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,2).sql index c300e6c1f52c..cb5ed427aab8 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,2).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,1).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,1).sql index 9e777d576406..d33f2aee99c0 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,1).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,2).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,2).sql index 9e777d576406..d33f2aee99c0 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,2).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS).sql index 57d2aa9ae36e..90ebbb70df14 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS).sql index 9e777d576406..d33f2aee99c0 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS).sql index f4b7a13ec511..86a2e4f497d6 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS).sql index b61c803d472c..da9c43123660 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS).sql index 230fd6ca4b1d..966003105faa 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS).sql index f434bf248aed..b6970ef9585d 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS).sql index 57d2aa9ae36e..90ebbb70df14 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS).sql index f29da0256f0c..67356274025d 100644 --- a/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS).sql index 2416f2033b5d..399429b9ac66 100644 --- a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS).sql index 2416f2033b5d..399429b9ac66 100644 --- a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS).sql index 68a93c1fcce2..0f17eb32f517 100644 --- a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS).sql index 68a93c1fcce2..0f17eb32f517 100644 --- a/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS).sql index 01e41e901e44..972f4bda98e9 100644 --- a/SqlServer.2025.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2025.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS).sql index 59d37c564fd8..f1cc7142ad09 100644 --- a/SqlServer.2025.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2025.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.MS).sql index 2c26510ef53b..86f0aa8e88fb 100644 --- a/SqlServer.2025.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..18904d15bd9d --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025.MS).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..29a3281399cf --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025.MS).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..6d984e2baf5e --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..56681c2cf16a --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..8f89af72ef59 --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..a75bc7bb5777 --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025.MS).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..ac02a3a1d829 --- /dev/null +++ b/SqlServer.2025.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025.MS).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS).sql index 1ec6d18404d8..c08470c514ce 100644 --- a/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS).sql index 9a452a387612..327cbf90b3f5 100644 --- a/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS).sql index c6d0d07c699c..4a7cead864ee 100644 --- a/SqlServer.2025.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2025.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2025.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 12be93ebdbf8..227e305d4572 100644 --- a/SqlServer.2025.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2025.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS).sql index b70b4e961e81..9aaa6ad904a7 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS).sql index 01082815b4f0..6b80b2ca478a 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS).sql index fc1c35cffba6..42b30f2263d6 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025.MS).sql index fc1c35cffba6..42b30f2263d6 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS).sql index 2b3579b0019d..04fe17af165a 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025.MS).sql index 4eec421665bb..9f91f526a9d8 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025.MS).sql index 4eec421665bb..9f91f526a9d8 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025.MS).sql index ca9fe568441f..b936ecb6af81 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025.MS).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS).sql index 166a84cd9367..2298d14daab5 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025.MS).sql index 17bfb2622eb3..9ddcd1721428 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS).sql index 91a3e2fedd92..a97fec2e6ce5 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS).sql index 9d2ac45ccc09..be9955a7496b 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS).sql index 75b066be320a..8ff3a865eee6 100644 --- a/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025.MS).sql index e4b9cbe4d5d7..ff404d345736 100644 --- a/SqlServer.2025.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 diff --git a/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS).sql index c46a964a4bc7..19606112ebd7 100644 --- a/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS).sql index c46a964a4bc7..19606112ebd7 100644 --- a/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025).sql b/SqlServer.2025/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025).sql index 5a6fe37ad1b9..1e36143ebfaa 100644 --- a/SqlServer.2025/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.2025).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025).sql b/SqlServer.2025/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025).sql new file mode 100644 index 000000000000..1da885790b2f --- /dev/null +++ b/SqlServer.2025/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.2025).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.2025/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025).sql b/SqlServer.2025/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025).sql new file mode 100644 index 000000000000..6f0f2502aaf9 --- /dev/null +++ b/SqlServer.2025/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.2025).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.2025/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025).sql b/SqlServer.2025/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025).sql index 7cdd17924f5c..53432080ca7f 100644 --- a/SqlServer.2025/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.2025).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025).sql index 5b7baa604f37..141ff5276b63 100644 --- a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.2025).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025).sql index 5b7baa604f37..141ff5276b63 100644 --- a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.2025).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025).sql index 9837336008bd..3b9e22ac6343 100644 --- a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.2025).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.2025/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025).sql index 887813afb9f2..e18e2822088b 100644 --- a/SqlServer.2025/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.2025).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.2025/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025,False).sql b/SqlServer.2025/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025,False).sql index 733624e046d1..48e6012c9ba1 100644 --- a/SqlServer.2025/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025,False).sql +++ b/SqlServer.2025/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.2025,False).sql @@ -2,27 +2,23 @@ -- SqlServer.2025 SqlServer.2022 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.2025 SqlServer.2022 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.2025/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025).sql index 82a8c0125a7a..efc0996a8968 100644 --- a/SqlServer.2025/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025).sql index 22851fdefe2c..6507f91db3fb 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.2025).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025).sql index 7124af720ef3..725691c7387e 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.2025).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025).sql index 2c8d5f9e335f..ce71673e24bf 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.2025).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025).sql index 5318e10a669f..467f166bace9 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.2025).sql @@ -2,16 +2,16 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025).sql index 5318e10a669f..467f166bace9 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.2025).sql @@ -2,16 +2,16 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025).sql index 21b65a308a94..5d6994ede27b 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.2025).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025).sql index b16fddc01086..27ec62889d86 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.2025).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025).sql index d2fd7922cffa..325dd6baaa24 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.2025).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025).sql index 73909a6b9a47..a3b35b6d6520 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025).sql index 02cdfb98af8d..240bfb1cc6d4 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.2025).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025).sql index 02cdfb98af8d..240bfb1cc6d4 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.2025).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025).sql index 035218704065..3c22053ce1d4 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.2025).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025).sql index f1b4a82633fa..4c8a92d77af4 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.2025).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025).sql index d62da9c397e4..2745dc831a8b 100644 --- a/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.2025).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.2025/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025).sql index 0781e97bfe16..9ffdc8eb36ce 100644 --- a/SqlServer.2025/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.2025).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.2025/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025).sql new file mode 100644 index 000000000000..9f101ee31995 --- /dev/null +++ b/SqlServer.2025/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.2025).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025).sql index 32f732c933b1..bb77a7427404 100644 --- a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.2025).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025).sql index 5b5dd6780aa9..4be3ddf8b31c 100644 --- a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.2025).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025).sql index 2635791a9388..41a051a19f02 100644 --- a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.2025).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025).sql index abb754c5c06a..5f6e3c4a294c 100644 --- a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.2025).sql @@ -2,13 +2,13 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025).sql index 8bf1ac66db53..46f8d09eb6e4 100644 --- a/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.2025).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025).sql index 818b9f14867a..a37ea776c851 100644 --- a/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.2025).sql @@ -2,7 +2,6 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025).sql index b7369eb17c84..0c9fa5917a15 100644 --- a/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.2025).sql @@ -2,7 +2,6 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025).sql index 8d1f4c406054..2d61c8015c9f 100644 --- a/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.2025).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025).sql index 4029836cfd46..a085f495db77 100644 --- a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.2025).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025).sql index 31f1217ffb6d..3ee538354f15 100644 --- a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.2025).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025).sql index fdb1821552c2..30f37889c5cd 100644 --- a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.2025).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025).sql index 9fa1c8b024b1..87d799acb3ea 100644 --- a/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.2025).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025).sql index 1e6cf84ab453..291cf9a8cc72 100644 --- a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.2025).sql @@ -2,87 +2,23 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.2025 SqlServer.2022 diff --git a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025).sql index 82fcebb87e33..f5f8cea50b95 100644 --- a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.2025).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025).sql index 83f745baf50a..e8accbc2db4a 100644 --- a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.2025).sql @@ -2,17 +2,17 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025).sql index 85e3b7118399..009eaef37699 100644 --- a/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.2025).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025).sql index c1db57bcb61a..9d76f245d910 100644 --- a/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.2025).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025).sql index 07692d6fc40e..53b0aec3fc65 100644 --- a/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.2025).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025).sql index e1082aba8930..d8c1002d450a 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025).sql index 2c202040b4d1..1467d9345411 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.2025).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025).sql index 79c5ff2527f0..21adb598755b 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,1).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,1).sql index 840d54f925bf..421784a48c8a 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,1).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,2).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,2).sql index 840d54f925bf..421784a48c8a 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,2).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,1).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,1).sql index 2c202040b4d1..1467d9345411 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,1).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,2).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,2).sql index 2c202040b4d1..1467d9345411 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,2).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.2025,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025).sql index f2808853a88a..4a492d0e43d7 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025).sql index 2c202040b4d1..1467d9345411 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.2025).sql @@ -2,12 +2,11 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025).sql index 79c5ff2527f0..21adb598755b 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025).sql index 0caffe1a1691..082e02fff9d7 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025).sql index 7c7d93ff1cef..38d17ecd0a13 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025).sql index e1082aba8930..d8c1002d450a 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025).sql index f2808853a88a..4a492d0e43d7 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025).sql index b721da22706d..e6b5b909d999 100644 --- a/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.2025).sql @@ -2,9 +2,14 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025).sql index 9b42327ed1d2..7fb521bf8c43 100644 --- a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.2025).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025).sql index 9b42327ed1d2..7fb521bf8c43 100644 --- a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.2025).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025).sql index 21f443cab582..0afd879d574d 100644 --- a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.2025).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025).sql index 21f443cab582..0afd879d574d 100644 --- a/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.2025).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.2025/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025).sql index 29629972d526..1f51a8336825 100644 --- a/SqlServer.2025/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.2025).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.2025/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025).sql index a1d5f62d990e..3881f6813480 100644 --- a/SqlServer.2025/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.2025).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.2025/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025).sql index 8e89cd83a858..ea673f4ee139 100644 --- a/SqlServer.2025/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.2025 SqlServer.2022 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025).sql new file mode 100644 index 000000000000..41c9950cc2ad --- /dev/null +++ b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.2025).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025).sql new file mode 100644 index 000000000000..9b1ee2fdd36b --- /dev/null +++ b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.2025).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025).sql new file mode 100644 index 000000000000..a23908ea7295 --- /dev/null +++ b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.2025).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025).sql new file mode 100644 index 000000000000..280400ce0668 --- /dev/null +++ b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.2025).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025).sql new file mode 100644 index 000000000000..52f79f083b1a --- /dev/null +++ b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.2025).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025).sql new file mode 100644 index 000000000000..98be70f356f0 --- /dev/null +++ b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.2025).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025).sql new file mode 100644 index 000000000000..de301fb664ac --- /dev/null +++ b/SqlServer.2025/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.2025).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025).sql index 9f3f2aee46fc..f593bd933295 100644 --- a/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.2025).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025).sql index 90284ed95725..053727e000db 100644 --- a/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.2025).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025).sql index 974e15cdd20a..66a215a073c5 100644 --- a/SqlServer.2025/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.2025).sql @@ -2,12 +2,12 @@ -- SqlServer.2025 SqlServer.2022 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.2025/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.2025/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index c621fc9b489c..13e785c6e1ff 100644 --- a/SqlServer.2025/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.2025/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.2025,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025).sql index e31d676e884c..a9db8fb3f4d5 100644 --- a/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.2025).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025).sql index 073c9bf512fa..932fc6dfe58d 100644 --- a/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.2025).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025).sql index 80c4bf71a028..741626f81e2d 100644 --- a/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.2025).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025).sql index 80c4bf71a028..741626f81e2d 100644 --- a/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.2025).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025).sql index cab9b5c3cf04..2d9e4177dffc 100644 --- a/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.2025).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025).sql index 4eec421665bb..9f91f526a9d8 100644 --- a/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.2025).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025).sql index 4eec421665bb..9f91f526a9d8 100644 --- a/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.2025).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.2025/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025).sql index 5ee0927eeca6..5e11fd0a724e 100644 --- a/SqlServer.2025/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.2025).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.2025/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025).sql index 2f73d842c34e..2f506f51eceb 100644 --- a/SqlServer.2025/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.2025).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.2025/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025).sql index 177d28ea4bd6..8311746508f6 100644 --- a/SqlServer.2025/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.2025).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.2025/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025).sql index dec85f886001..a7607e56441f 100644 --- a/SqlServer.2025/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.2025).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025).sql index 06bfe7a46dfe..79dc1db22ee8 100644 --- a/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.2025).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025).sql index 8022265c1761..b6db51ba99b8 100644 --- a/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.2025).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.2025/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025).sql index af4d7202838c..5f769a771cb5 100644 --- a/SqlServer.2025/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.2025).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2025 SqlServer.2022 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.2025 SqlServer.2022 diff --git a/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025).sql b/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025).sql index 546ee972344e..0b1fa888fc87 100644 --- a/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.2025).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025).sql b/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025).sql index 546ee972344e..0b1fa888fc87 100644 --- a/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.2025).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..69ec8c1654e0 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.Contained.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..2d905e55ed3d --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.Contained.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.LinqService).sql index c95119d2ff67..c444a52aea4d 100644 --- a/SqlServer.Contained.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.LinqService).sql index 9a9d59884f23..99b46a0bf94f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.Contained.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.LinqService,False).sql b/SqlServer.Contained.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.LinqService,False).sql index f452458de182..e74f5eb22e1f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.LinqService,False).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.Contained.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.LinqService).sql index 12025bf9cd60..58bf1fad4908 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.LinqService).sql index 820898c62597..abfc645230ba 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.LinqService).sql index 2106a5303dbf..5ef625af85ce 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.LinqService).sql index bd5da68c6cec..20c940aaa672 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.LinqService).sql index 20f8b3833c41..559a696cb8a0 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.LinqService).sql index 20f8b3833c41..559a696cb8a0 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.LinqService).sql index 3c1f9106bac6..0e883c11f4b0 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.LinqService).sql index 1f1daa6abeee..915647c06dee 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.LinqService).sql index 006e2af08c1c..5c6787e57bca 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.LinqService).sql index 1dddde698485..07f64e50c923 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.LinqService).sql index 3668e7b473ac..99ad37f33a8d 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.LinqService).sql index 3668e7b473ac..99ad37f33a8d 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.LinqService).sql index fefe6f946a5b..554b4c411a0e 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.LinqService).sql index fefe6f946a5b..554b4c411a0e 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.LinqService).sql index 71834de8c4d3..1c78e5f97fbc 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.LinqService).sql index 1493c9b876e5..77b14c2ceaf6 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..be23c976e20b --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.LinqService).sql index d505e421ca12..2c2006a7fad5 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.LinqService).sql index 40a5c3de9452..e9d77544c097 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.LinqService).sql index 8e919f974876..8d9d3ba6ae06 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.LinqService).sql index 2ee1a4b290a8..26271e9a46aa 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.LinqService).sql index 58eaf80269cd..33b0c14260cc 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.LinqService).sql index 0687b698f65c..92cb407a9176 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.LinqService).sql index 89ced68ce39d..88756d0cd79a 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.LinqService).sql index d20e1fd51ec0..890a10f9e681 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.LinqService).sql index df52ccef2014..ce24b05de655 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.LinqService).sql index 1d055251ca19..818cf18027fa 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.LinqService).sql index 5c4ed8762d76..52f2900e3480 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.LinqService).sql index ea083a941cb5..51247902ac02 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.LinqService).sql index e900ea113259..f1dad2bdc2e6 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.LinqService).sql index 0f62eab841f2..f5c8238f7d18 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.LinqService).sql index ffec4f339d2d..f0f748996621 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.LinqService).sql index babb3445e361..cd34f704c644 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.LinqService).sql index 686e4ca67f12..e6486ad57e23 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.LinqService).sql index 263e6bb82153..e93a1d96fcd0 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,1).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,1).sql index fd54e25eaa26..14f7c11e5cf4 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,1).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,2).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,2).sql index fd54e25eaa26..14f7c11e5cf4 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,2).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,1).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,1).sql index 686e4ca67f12..e6486ad57e23 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,1).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,2).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,2).sql index 686e4ca67f12..e6486ad57e23 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,2).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.LinqService).sql index 32393e621186..a3c9b22729dd 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.LinqService).sql index 686e4ca67f12..e6486ad57e23 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.LinqService).sql index 263e6bb82153..e93a1d96fcd0 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.LinqService).sql index 8db4f25cb994..5d4448aa7566 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.LinqService).sql index c6704e063e37..927db0d521ed 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.LinqService).sql index babb3445e361..cd34f704c644 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.LinqService).sql index 32393e621186..a3c9b22729dd 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.LinqService).sql index 4fbbe4a053c8..5001ce422bb6 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.LinqService).sql index cfd5d4892a1a..77638f1fcd33 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.LinqService).sql index cfd5d4892a1a..77638f1fcd33 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.LinqService).sql index 210083ea0f4d..300feea748cd 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.LinqService).sql index 210083ea0f4d..300feea748cd 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.LinqService).sql index be204e1dace7..60f61af5624c 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.LinqService).sql index 034796f716b4..da29c6ec6e11 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..4cbfc8008a06 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..e087b48c91a1 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..fc1637b1ec72 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..d218226491fe --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..c824bb2ae91c --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..c824bb2ae91c --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..566b7882d165 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.LinqService).sql new file mode 100644 index 000000000000..3d554d13af59 --- /dev/null +++ b/SqlServer.Contained.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.LinqService).sql index 0ce2172d2bc0..ce4641bcdd36 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.LinqService).sql index cc09118f4811..58abfefa2f81 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.LinqService).sql index 89316d01b2fe..7303b91effef 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.Contained.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.Contained.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index e651800549b3..6218f8ed92b6 100644 --- a/SqlServer.Contained.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.Contained.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.Contained SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.LinqService).sql index f06f66f3f19d..2a1664d807e6 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.LinqService).sql index 78310adc0c8d..29f96e42f125 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.LinqService).sql index 5f06c6765178..60bbf7c800dc 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.LinqService).sql index 76ed6afb5676..bce38e801134 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.LinqService).sql index ae913a4be863..d7da4188f44f 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.LinqService).sql index b74a5a24ce03..aca66d6951f2 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.LinqService).sql index b55c738a000e..ce08bfe9163a 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.LinqService).sql index 8ad5bcad1d44..c55c5844ab74 100644 --- a/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.LinqService).sql index da63915297a5..3f2ad46cef4c 100644 --- a/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.LinqService).sql index da63915297a5..3f2ad46cef4c 100644 --- a/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..405b18e6dd87 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..b5915387dea6 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS.LinqService).sql index e245865a1d4a..191c00e2707c 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS.LinqService).sql index 818d948b2fde..b17ce8bf43df 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS.LinqService,False).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS.LinqService,False).sql index f3600dd80ae4..9f7f95c54db9 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS.LinqService,False).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS.LinqService).sql index 1c2d9277f336..4fcc7379166e 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS.LinqService).sql index 1015ea848679..65255f1627d8 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS.LinqService).sql index 1c17699efe43..e4ef2c37001e 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS.LinqService).sql index 5644eabc92ab..6a0d6359e4dc 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS.LinqService).sql index 9aa976ac7357..6b9ab4731b2a 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS.LinqService).sql index 9aa976ac7357..6b9ab4731b2a 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS.LinqService).sql index 7d80f4372e5d..ec0e1ce7a3bc 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS.LinqService).sql index e264f9c6a29d..3f92fb54cffd 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS.LinqService).sql index ff498cb7a954..1097747398c0 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS.LinqService).sql index bbffbfa2212a..449143985598 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS.LinqService).sql index bb1686b15311..b9d758ac6781 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS.LinqService).sql index bb1686b15311..b9d758ac6781 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS.LinqService).sql index a89537a15c51..4c720a4c1ab8 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS.LinqService).sql index a89537a15c51..4c720a4c1ab8 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS.LinqService).sql index b2fe3deb4e31..11e906f18f5f 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS.LinqService).sql index 27099bdf19d4..a06c7cc7d182 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..143233590366 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS.LinqService).sql index 0479d7fd19f6..cfdc36f406e1 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS.LinqService).sql index 37b901c40c42..215e04041b12 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS.LinqService).sql index 581c602683fe..3a01da5cd9f7 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS.LinqService).sql index 0178cca7222c..4636b9a5f56d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS.LinqService).sql index b3dea1fb00bf..6b0cf4d9e829 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS.LinqService).sql index 3562e5a215c8..fc1ba4ebd25a 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS.LinqService).sql index 63a72c5315d2..db40adbc11c1 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS.LinqService).sql index 022027b655d0..4ecc754f2cdb 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS.LinqService).sql index 9a678b9bd46d..ed89fc7e42cb 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS.LinqService).sql index 5a82468e2a0a..531848c430a5 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS.LinqService).sql index acb9a0b0ed00..41eddc009afd 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS.LinqService).sql index 9327f5e38204..2f5112352a20 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS.LinqService).sql index b2a871711c3a..5d5a5708107d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS.LinqService).sql index c51ed6af6544..d09493c79ba0 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS.LinqService).sql index 54b4ef2cccd3..1d844fb1fee0 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS.LinqService).sql index e12e9e005f6f..0ad4d819442d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS.LinqService).sql index 0badaba2b17a..d6ac0469cb73 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS.LinqService).sql index f981382e9891..687a491793ad 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,1).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,1).sql index d48ee522b777..1a0e292d2888 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,2).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,2).sql index d48ee522b777..1a0e292d2888 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,1).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,1).sql index 0badaba2b17a..d6ac0469cb73 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,1).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,2).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,2).sql index 0badaba2b17a..d6ac0469cb73 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,2).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS.LinqService).sql index 4d20db1dc388..069ede380b1d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS.LinqService).sql index 0badaba2b17a..d6ac0469cb73 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS.LinqService).sql index f981382e9891..687a491793ad 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS.LinqService).sql index 35b5f4fdfcf9..c67ffda6e621 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS.LinqService).sql index 935d94ae941e..4c8afb3fed8b 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS.LinqService).sql index e12e9e005f6f..0ad4d819442d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS.LinqService).sql index 4d20db1dc388..069ede380b1d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS.LinqService).sql index 65628a2f7f6a..0e4e064a676d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS.LinqService).sql index 4239715e02e7..0c4f13d5e70b 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS.LinqService).sql index 4239715e02e7..0c4f13d5e70b 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS.LinqService).sql index 07ea348e4aad..a500009a06c3 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS.LinqService).sql index 07ea348e4aad..a500009a06c3 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS.LinqService).sql index a3709f4b5c1f..cddc476ceb77 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS.LinqService).sql index f30054c5561c..b7a4e3828e1d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..47413922fb99 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..27dbf2d893e2 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..414e0972f7d8 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..0da9b4322caa --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..1504463ac27a --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..1504463ac27a --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..c12731585093 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.MS.LinqService).sql new file mode 100644 index 000000000000..4475c3b524c9 --- /dev/null +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.MS.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS.LinqService).sql index ed45caa787fb..f42605ed630e 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS.LinqService).sql index a65c2c4948c4..2c5a5a984a09 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS.LinqService).sql index 41c99b3baf35..e81a11bb84c3 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.Contained.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.Contained.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 064ed4e004fe..21d1a1070a54 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS.LinqService).sql index 17fddeeddd2f..c6d27c0bc824 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS.LinqService).sql index eca36f2f93f3..f6c088f0abf1 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS.LinqService).sql index 01b0f862d577..8e16bd80aac8 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS.LinqService).sql index 20049920b0d5..687241e1d510 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS.LinqService).sql index 1fb1221a1633..e5bc2482cf86 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS.LinqService).sql index 1da4791a8676..26b9b20829bc 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS.LinqService).sql index fbbf3d27d65a..768e5477d58c 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS.LinqService).sql index 217672a9d37c..126803e7920c 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS.LinqService).sql index 3b477b02ce30..4dad3b14fbfc 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS.LinqService).sql index 3b477b02ce30..4dad3b14fbfc 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained.MS).sql index 8af572b7daab..3ef9c4e846a3 100644 --- a/SqlServer.Contained.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..b70f22836775 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.Contained.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..cdc96ab2d757 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.Contained.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS).sql index 4433bcb880fa..1d523ce7a80e 100644 --- a/SqlServer.Contained.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained.MS).sql index c341544ec104..d979448c5b91 100644 --- a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained.MS).sql index c341544ec104..d979448c5b91 100644 --- a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained.MS).sql index 64093d3f0882..97840589fda4 100644 --- a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.Contained.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS).sql index 88fb4159c680..6032e1d0a12f 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.Contained.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS,False).sql index 31a3ae19d6d9..94b64b115198 100644 --- a/SqlServer.Contained.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS,False).sql +++ b/SqlServer.Contained.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.Contained.MS SqlServer.2019 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.Contained.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS).sql index 1306c6e71633..b249f02f5916 100644 --- a/SqlServer.Contained.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS).sql index 18015ad8f4ea..678572448406 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS).sql index e3ad81e622db..f337d54cbc24 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS).sql index 600dad7854c4..32404c5e68ae 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS).sql index 65fbee55a155..dbe298016a54 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS).sql index 65fbee55a155..dbe298016a54 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS).sql index 070da7372c3c..97e412912b61 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS).sql index 09895a234e49..e1cbe51af393 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS).sql index f4480a2505ab..fc053f6c9411 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS).sql index c357b10afd33..8bce07aa1ee0 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS).sql index 36bd530d6eea..0768fe8ad9ae 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS).sql index 36bd530d6eea..0768fe8ad9ae 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS).sql index be24dec20ca0..2645a31e7a7d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS).sql index a89537a15c51..4c720a4c1ab8 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS).sql index 8ab4159df66f..07934938be37 100644 --- a/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.Contained.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS).sql index 726bde38f910..8c6ace4b6c0b 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..c1a5f41c6a16 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS).sql index f05d856216c6..452fae011d5b 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS).sql index 81e428516845..171eed8531aa 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS).sql index 62553c25bc04..14f46de20102 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS).sql index e6f86659faa3..3a3801deb2bf 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS).sql index 44fef32a5b0c..89a07860d0a9 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained.MS).sql index 93ee36da81c2..3367cb41027a 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained.MS).sql index 067b0372deab..71ac562d944b 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained.MS).sql index 2dfb89d48e44..f7c22b0c1629 100644 --- a/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS).sql index 63d8c52f0d11..680474677394 100644 --- a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS).sql index 0554987abc89..5aefc35183a2 100644 --- a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS).sql index b55bb8008d9e..ce1c6890968b 100644 --- a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS).sql index 17122b7d0f38..968430e1ecb8 100644 --- a/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS).sql index d5568997ad00..4c8fdd0b3bd3 100644 --- a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 diff --git a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS).sql index 78d117f0c26a..124aadcbac6c 100644 --- a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS).sql index f332a028af36..24aea93c7aec 100644 --- a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS).sql index 8da1d131b9c3..06c575d95982 100644 --- a/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS).sql index 73fe94b07588..dd174d70961f 100644 --- a/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS).sql index 8b27522b434a..db746642a2d9 100644 --- a/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS).sql index a5743b969fe4..7b7fc7178dc1 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS).sql index 83547470dff7..ca8290f3586c 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS).sql index 7782d2eca835..a78bb83f0ab9 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,1).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,1).sql index cd1aeb2fda36..6b52845398ce 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,1).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,2).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,2).sql index cd1aeb2fda36..6b52845398ce 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,2).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,1).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,1).sql index 83547470dff7..ca8290f3586c 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,1).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,2).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,2).sql index 83547470dff7..ca8290f3586c 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,2).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS).sql index fa30609659a1..15a7de07cc2d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS).sql index 83547470dff7..ca8290f3586c 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS).sql index 7782d2eca835..a78bb83f0ab9 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS).sql index ac9d37fd62f8..84437617e06d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS).sql index 8dfbe452170b..35c71ca140d9 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS).sql index a5743b969fe4..7b7fc7178dc1 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS).sql index fa30609659a1..15a7de07cc2d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS).sql index 60f9c8d80bcb..672cb28ef706 100644 --- a/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS).sql index 3831ebcf2f82..d5ef7fa1909e 100644 --- a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS).sql index 3831ebcf2f82..d5ef7fa1909e 100644 --- a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS).sql index f66c65cb568d..1c95fef1410d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS).sql index f66c65cb568d..1c95fef1410d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS).sql index 412554351d41..8a6942c97180 100644 --- a/SqlServer.Contained.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.Contained.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS).sql index a2ad2f86e6ec..638e1d457682 100644 --- a/SqlServer.Contained.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.Contained.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.MS).sql index 57f4c5a43bb3..991902b40810 100644 --- a/SqlServer.Contained.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..e3e22be1c6c2 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained.MS).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..64e0f4d38d10 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained.MS).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..a9f611a06832 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..1504463ac27a --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..49c764b3afb8 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..fbae57cd23e1 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained.MS).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..caf91b2d4ed4 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained.MS).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS).sql index 36449910f4a1..107ca53cf44a 100644 --- a/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS).sql index f39c8d07d5ae..a40d54a9b26c 100644 --- a/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS).sql index b52dac7e7794..76a5879ae16d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.Contained.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.Contained.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index e13624c5a2ad..cb38397cbaa2 100644 --- a/SqlServer.Contained.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.Contained.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS).sql index 0e159a0efc13..b489989b30c2 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS).sql index 7516f4d185e8..7aa7a8ff321d 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS).sql index 9cde327fbdcf..24f6d0b1af38 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained.MS).sql index 9cde327fbdcf..24f6d0b1af38 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS).sql index fa6d75f2218f..ccc63ed0da98 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained.MS).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained.MS).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained.MS).sql index 8ec89676cbb0..4a8d3a6374be 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained.MS).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS).sql index d29253b300f5..40d646ea6b33 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained.MS).sql index e6da620cafc3..f4703fcfe498 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS).sql index cce073ce501b..01958e79364d 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS).sql index a21583c95175..c5b4f4dfdff7 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS).sql index edeaf255b1bc..b3068e5d12a6 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained.MS).sql index 66a035ec7034..176fb54b5324 100644 --- a/SqlServer.Contained.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.Contained.MS SqlServer.2019 diff --git a/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS).sql index 26a58eeaeb29..fef20b97425a 100644 --- a/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS).sql index 26a58eeaeb29..fef20b97425a 100644 --- a/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained).sql b/SqlServer.Contained/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained).sql index 88356e542537..6098a2700ae6 100644 --- a/SqlServer.Contained/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.Contained).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained).sql new file mode 100644 index 000000000000..47c1d975efb7 --- /dev/null +++ b/SqlServer.Contained/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.Contained).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.Contained/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained).sql new file mode 100644 index 000000000000..c428aaab3bb0 --- /dev/null +++ b/SqlServer.Contained/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.Contained).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.Contained/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained).sql index 030d43ff104c..e0df56cae15c 100644 --- a/SqlServer.Contained/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.Contained).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained).sql index 26f7c1bdd7e3..0c979ba7c640 100644 --- a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.Contained).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained).sql index 26f7c1bdd7e3..0c979ba7c640 100644 --- a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.Contained).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained).sql index 1a370cd89b8c..8929bbe98a6a 100644 --- a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.Contained).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.Contained/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained).sql index 664c0a6dcd3a..a2293b54b462 100644 --- a/SqlServer.Contained/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.Contained).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.Contained/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained,False).sql b/SqlServer.Contained/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained,False).sql index 63aad4df2da3..7581ebc8c1bc 100644 --- a/SqlServer.Contained/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained,False).sql +++ b/SqlServer.Contained/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.Contained,False).sql @@ -2,27 +2,23 @@ -- SqlServer.Contained SqlServer.2019 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.Contained SqlServer.2019 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.Contained/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained).sql index 44a1874f3b5f..559830a5b03f 100644 --- a/SqlServer.Contained/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained).sql index aa9d94c1ad2d..24936e50c9d6 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.Contained).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained).sql index 4d03ba052273..0f9974ad6c29 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.Contained).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained).sql index 66ebcdb90f77..2972c303953a 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.Contained).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained).sql index 7a815105823f..cbb00324aa57 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.Contained).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained).sql index 7a815105823f..cbb00324aa57 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.Contained).sql @@ -2,16 +2,16 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained).sql index 017f96795c52..4ce430d34a3f 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.Contained).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained).sql index a2a2afa0a0a1..e49f1be9949d 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.Contained).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained).sql index c531c09285c4..5a2017994fe5 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.Contained).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained).sql index 030672e3ebbe..21dc71bf18bf 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained).sql index d7fac4fcb5d2..09775bb8f2e7 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.Contained).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained).sql index d7fac4fcb5d2..09775bb8f2e7 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.Contained).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained).sql index eeb4aea81b5f..1154ee3e4213 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.Contained).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained).sql index fefe6f946a5b..554b4c411a0e 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.Contained).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained).sql index bfcde3a14505..8f119e72f892 100644 --- a/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.Contained).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.Contained/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained).sql index 3f7ec2b12d32..ab5b814745bb 100644 --- a/SqlServer.Contained/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.Contained).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.Contained/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained).sql new file mode 100644 index 000000000000..88ff7ab9e32a --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.Contained).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained).sql index 3e901ce2bf01..dbe211f27a03 100644 --- a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.Contained).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained).sql index b1244f849bcd..508463b417ed 100644 --- a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.Contained).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained).sql index 30a68958fa9c..9ee41d2a291a 100644 --- a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.Contained).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained).sql index 2c3cd86322c0..226a28c1e11e 100644 --- a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.Contained).sql @@ -2,13 +2,13 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained).sql index 05c835c5e434..9b61b3d2d3ae 100644 --- a/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.Contained).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained).sql index 68b308faf32a..5c07ee30dd46 100644 --- a/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.Contained).sql @@ -2,7 +2,6 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained).sql index a43ec8019850..419f644cd0ce 100644 --- a/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.Contained).sql @@ -2,7 +2,6 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained).sql index 7a6c0024156c..6d3f83c56054 100644 --- a/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.Contained).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained).sql index 31de920e6c2b..d62afd905795 100644 --- a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.Contained).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained).sql index a97c1d1960a9..df73815d3031 100644 --- a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.Contained).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained).sql index 1e811d5265a3..4fdb30f72163 100644 --- a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.Contained).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained).sql index 8251e7957618..633013d61439 100644 --- a/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.Contained).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained).sql index a1021d714cd5..0e5ec54473e7 100644 --- a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.Contained).sql @@ -2,87 +2,23 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.Contained SqlServer.2019 diff --git a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained).sql index dd4e219ce1e3..a2630a9cbd33 100644 --- a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.Contained).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained).sql index 8f26f74a9221..60a2d873340a 100644 --- a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.Contained).sql @@ -2,17 +2,17 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained).sql index 1613b730d5bf..ba1bd01386bb 100644 --- a/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.Contained).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained).sql index cee18b90a4d7..4380df9e6ac1 100644 --- a/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.Contained).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained).sql index 4a2182a531cb..9d2aa6c11024 100644 --- a/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.Contained).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained).sql index e80d1e9447e6..fa87c812cdc2 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained).sql index 9f5a08f529f4..3af339d465c9 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.Contained).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained).sql index 99f3e77c4e2a..9a292f1124be 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,1).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,1).sql index e6e7d0331eb8..3c56fd9528d5 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,1).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,2).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,2).sql index e6e7d0331eb8..3c56fd9528d5 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,2).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,1).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,1).sql index 9f5a08f529f4..3af339d465c9 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,1).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,2).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,2).sql index 9f5a08f529f4..3af339d465c9 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,2).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.Contained,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained).sql index 8256fd5e30f9..100bb6d39c1f 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained).sql index 9f5a08f529f4..3af339d465c9 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.Contained).sql @@ -2,12 +2,11 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained).sql index 99f3e77c4e2a..9a292f1124be 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained).sql index 8cd92cfd36d5..7e2fca86a23a 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained).sql index 7af9c422b40c..8a468ead7334 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained).sql index e80d1e9447e6..fa87c812cdc2 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained).sql index 8256fd5e30f9..100bb6d39c1f 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained).sql index 9274a316558d..7219fa3eb5b5 100644 --- a/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.Contained).sql @@ -2,9 +2,14 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained).sql index 12a11175abd9..a67b87593d10 100644 --- a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.Contained).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained).sql index 12a11175abd9..a67b87593d10 100644 --- a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.Contained).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained).sql index 3a2c70c8a933..d83e9846e5ab 100644 --- a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.Contained).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained).sql index 3a2c70c8a933..d83e9846e5ab 100644 --- a/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.Contained).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.Contained/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained).sql index 965a113a39c9..097dcd7951ca 100644 --- a/SqlServer.Contained/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.Contained).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.Contained/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained).sql index d0a02c6d0924..b2bfeb922569 100644 --- a/SqlServer.Contained/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.Contained).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.Contained/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained).sql index 4736349c6812..c31b4ecb3c57 100644 --- a/SqlServer.Contained/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.Contained SqlServer.2019 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained).sql new file mode 100644 index 000000000000..93c64269167c --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.Contained).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained).sql new file mode 100644 index 000000000000..b554287abfba --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.Contained).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained).sql new file mode 100644 index 000000000000..0a00524e1f09 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.Contained).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained).sql new file mode 100644 index 000000000000..c824bb2ae91c --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.Contained).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained).sql new file mode 100644 index 000000000000..01a8d40fb613 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.Contained).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained).sql new file mode 100644 index 000000000000..4f9faac63585 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.Contained).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained).sql new file mode 100644 index 000000000000..5b9a3af70d85 --- /dev/null +++ b/SqlServer.Contained/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.Contained).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained).sql index 7bb82a8374b8..058908d3ecc8 100644 --- a/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.Contained).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained).sql index e8f84ced8924..b3be87dc7ff5 100644 --- a/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.Contained).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained).sql index 976c1f9beea4..af9c4b411868 100644 --- a/SqlServer.Contained/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.Contained).sql @@ -2,12 +2,12 @@ -- SqlServer.Contained SqlServer.2019 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.Contained/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.Contained/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index ef545455f54b..893e56423d9f 100644 --- a/SqlServer.Contained/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.Contained/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.Contained,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained).sql index c6526e5a9910..726b0298a288 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.Contained).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained).sql index 5b29d4122592..3c5a93047bf6 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.Contained).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained).sql index 2865e4206e8f..8bac6e8aa1fc 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.Contained).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained).sql index 2865e4206e8f..8bac6e8aa1fc 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.Contained).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained).sql index da62598f87f0..049fa0b7730b 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.Contained).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.Contained).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.Contained).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.Contained/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained).sql index c4ffae445337..6dea7d9d8425 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.Contained).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.Contained/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained).sql index 7f0aa856d1ef..332dee99f100 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.Contained).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.Contained/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained).sql index 26fb34912a60..1fe34367e82e 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.Contained).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.Contained/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained).sql index 4614dd2f810c..6722281dbb06 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.Contained).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained).sql index 07c3f2bef31b..14a3f60acaa0 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.Contained).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained).sql index febd8f888f19..38f2cb86cec8 100644 --- a/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.Contained).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.Contained/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained).sql index 3d51ec8417af..2deaebeafd0a 100644 --- a/SqlServer.Contained/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.Contained).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.Contained SqlServer.2019 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.Contained SqlServer.2019 diff --git a/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained).sql b/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained).sql index 5aea3b458f61..51b6bb889038 100644 --- a/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.Contained).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained).sql b/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained).sql index 5aea3b458f61..51b6bb889038 100644 --- a/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.Contained).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind.MS).sql b/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind.MS).sql index 825defa2f8e4..dab34d9cdd90 100644 --- a/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind.MS).sql +++ b/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind.MS).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80, 1, 0) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80, 1, 0) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind.MS).sql b/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind.MS).sql index e8e897255aa1..85c53739c01b 100644 --- a/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind.MS).sql +++ b/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind.MS).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25, 1, 0) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25, 1, 0) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind.MS).sql b/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind.MS).sql index 955fb8e7c92e..96f27762acab 100644 --- a/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind.MS).sql +++ b/SqlServer.Northwind.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind.MS).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25, 0, 1) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25, 0, 1) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind.MS).sql b/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind.MS).sql index 712b9e467cb7..b85b1802a622 100644 --- a/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind.MS).sql +++ b/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind.MS).sql @@ -3,13 +3,13 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_1] + [g_2].[Count_1] FROM ( SELECT [a_Employee].[EmployeeID], - [a_Employee].[LastName], - COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [COUNT_1] + COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [Count_1], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] diff --git a/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind.MS).sql b/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind.MS).sql index 3b6198cc11de..231faaaa98f9 100644 --- a/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind.MS).sql +++ b/SqlServer.Northwind.MS/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind.MS).sql @@ -3,14 +3,14 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_2] + [g_2].[Count_2] FROM ( SELECT [a_Employee].[EmployeeID], - COUNT(*) as [COUNT_1], - [a_Employee].[LastName], - COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [COUNT_2] + COUNT(*) as [Count_1], + COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [Count_2], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] @@ -27,5 +27,5 @@ WHERE WHERE [g_2].[EmployeeID] = [a_EmployeeTerritories].[EmployeeID] ) > 1 AND - [g_2].[COUNT_1] > 2 + [g_2].[Count_1] > 2 diff --git a/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind.MS).sql b/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind.MS).sql index 825defa2f8e4..dab34d9cdd90 100644 --- a/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind.MS).sql +++ b/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind.MS).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80, 1, 0) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80, 1, 0) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind.MS).sql b/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind.MS).sql index f11490e2aa03..9774f5d54a15 100644 --- a/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind.MS).sql +++ b/SqlServer.Northwind.MS/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.Northwind.MS SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Customers] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Orders] [o] INNER JOIN [Customers] [a_Customer] ON [o].[CustomerID] = [a_Customer].[CustomerID] diff --git a/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind).sql b/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind).sql index ad94db4796a3..e7e815914514 100644 --- a/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind).sql +++ b/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate2(SqlServer.Northwind).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80, 1, 0) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80, 1, 0) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind).sql b/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind).sql index bea927a13899..7079da8490de 100644 --- a/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind).sql +++ b/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate21(SqlServer.Northwind).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25, 1, 0) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25, 1, 0) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind).sql b/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind).sql index 8ff26004df68..5a89fd61ea3a 100644 --- a/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind).sql +++ b/SqlServer.Northwind/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAggregate22(SqlServer.Northwind).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) = 33.25, 0, 1) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) = 33.25, 0, 1) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind).sql b/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind).sql index 4caa316bb661..7237d8619bca 100644 --- a/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind).sql +++ b/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains11(SqlServer.Northwind).sql @@ -3,13 +3,13 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_1] + [g_2].[Count_1] FROM ( SELECT [a_Employee].[EmployeeID], - [a_Employee].[LastName], - COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [COUNT_1] + COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [Count_1], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] diff --git a/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind).sql b/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind).sql index d49f88774620..ba8658b7cdb8 100644 --- a/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind).sql +++ b/SqlServer.Northwind/Tests/Linq/SetTests/Tests.Linq.SetTests.Contains12(SqlServer.Northwind).sql @@ -3,14 +3,14 @@ SELECT [g_2].[LastName], - [g_2].[COUNT_2] + [g_2].[Count_2] FROM ( SELECT [a_Employee].[EmployeeID], - COUNT(*) as [COUNT_1], - [a_Employee].[LastName], - COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [COUNT_2] + COUNT(*) as [Count_1], + COUNT(IIF([a_Employee].[FirstName] LIKE N'%an%' ESCAPE N'~', 1, NULL)) as [Count_2], + [a_Employee].[LastName] FROM [EmployeeTerritories] [g_1] LEFT JOIN [Employees] [a_Employee] ON [g_1].[EmployeeID] = [a_Employee].[EmployeeID] @@ -27,5 +27,5 @@ WHERE WHERE [g_2].[EmployeeID] = [a_EmployeeTerritories].[EmployeeID] ) > 1 AND - [g_2].[COUNT_1] > 2 + [g_2].[Count_1] > 2 diff --git a/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind).sql b/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind).sql index ad94db4796a3..e7e815914514 100644 --- a/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind).sql +++ b/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.GroupByAggregate(SqlServer.Northwind).sql @@ -19,27 +19,20 @@ SELECT FROM ( SELECT DISTINCT - [t2].[Key_1] - FROM - ( + IIF(( SELECT - IIF(( - SELECT - AVG([a_Orders].[Freight]) - FROM - [Orders] [a_Orders] - WHERE - [t1].[CustomerID] = [a_Orders].[CustomerID] - ) >= 80, 1, 0) as [Key_1] + AVG([a_Orders].[Freight]) FROM - [Customers] [t1] - ) [t2] - GROUP BY - [t2].[Key_1] + [Orders] [a_Orders] + WHERE + [t1].[CustomerID] = [a_Orders].[CustomerID] + ) >= 80, 1, 0) as [Key_1] + FROM + [Customers] [t1] ) [m_1] INNER JOIN [Customers] [d] ON IIF([m_1].[Key_1] = 1, 1, 0) = IIF(( SELECT - AVG([a_Orders_1].[Freight]) as [AVG_1] + AVG([a_Orders_1].[Freight]) as [Average] FROM [Orders] [a_Orders_1] WHERE diff --git a/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind).sql b/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind).sql index 5bc03fbc7603..8508302c7ff5 100644 --- a/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind).sql +++ b/SqlServer.Northwind/Tests/OrmBattle/OrmBattleTests/Tests.OrmBattle.OrmBattleTests.MaxCountTest(SqlServer.Northwind).sql @@ -2,12 +2,12 @@ -- SqlServer.Northwind SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Customers] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Orders] [o] INNER JOIN [Customers] [a_Customer] ON [o].[CustomerID] = [a_Customer].[CustomerID] diff --git a/SqlServer.SA.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..f53303f82490 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.SA.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..bda3f468d26c --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.SA.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.LinqService).sql index bb98268807c6..9e72d0c1fe36 100644 --- a/SqlServer.SA.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.SA.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.LinqService).sql index b019d205d042..0a7d04ac64e4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.SA.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.LinqService,False).sql b/SqlServer.SA.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.LinqService,False).sql index 3c7facbc8288..38fbd4430d69 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.LinqService,False).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.SA.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.LinqService).sql index b9682f435322..8d037b70e2a4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.LinqService).sql index 4732505980f8..639f6ef7b90d 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.LinqService).sql index e930af165288..d8a7ff9465e4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.LinqService).sql index cd15d22126cb..f758351acf7d 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.LinqService).sql index d92c9abcd93f..a3bb32f177ca 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.LinqService).sql index d92c9abcd93f..a3bb32f177ca 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.LinqService).sql index 731a68b38108..59743792f28f 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.LinqService).sql index c6f94396c129..8c4b7455e504 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.LinqService).sql index b766607e0f91..e42ab1c51f1e 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.LinqService).sql index c886af40c67b..4b9b99da5bf7 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.LinqService).sql index 217d515c6f91..21072d190791 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.LinqService).sql index 217d515c6f91..21072d190791 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.LinqService).sql index e9d7418c3632..061a957729f6 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.LinqService).sql index e9d7418c3632..061a957729f6 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.LinqService).sql index ebc105225412..250552962d74 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.SA.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.LinqService).sql index efb69c60305e..35a70a55a7bb 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..400c7805029b --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.LinqService).sql index 80e1142955f7..ba462ca6616a 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.LinqService).sql index c4e7c38c5136..bade4f7406d4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.LinqService).sql index 3239bac37c9f..c6142fe7f4ca 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.LinqService).sql index f312d479395a..26df11462c63 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.LinqService).sql index ac0e16edd160..cdc87bfd864c 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.LinqService).sql index 21958cadd3dd..1dffff0e68e9 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.LinqService).sql index afff07088106..d87d3c6ab3be 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.LinqService).sql index 4f306ddb08ed..b4e571dfbdac 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.LinqService).sql index b7be50711db3..88be976b630e 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.LinqService).sql index ab68d2056ccf..81f377aa4792 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.LinqService).sql index 6e791dc1e673..48fd4ab8bbf0 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.LinqService).sql index 148e69b0c1aa..69019eb1707f 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.LinqService).sql index be85302b0d83..3b94de5d7fdd 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.LinqService).sql index d791ef653c6e..5f5ff62600b0 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.LinqService).sql index 629dd82f59f1..15869f7185eb 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.LinqService).sql index e6f47aa953c3..1614beebd5da 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.LinqService).sql index 01e54c50282a..86860041a333 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.LinqService).sql index dc071e30db3b..846bcc675ae4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,1).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,1).sql index 17be16f341d7..19b894f0d6b0 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,1).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,2).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,2).sql index 17be16f341d7..19b894f0d6b0 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,2).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,1).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,1).sql index 01e54c50282a..86860041a333 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,1).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,2).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,2).sql index 01e54c50282a..86860041a333 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,2).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.LinqService).sql index 2320c7076da8..ade0640ee06e 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.LinqService).sql index 01e54c50282a..86860041a333 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.LinqService).sql index dc071e30db3b..846bcc675ae4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.LinqService).sql index 4d7632dbd4b8..da98f36f86a2 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.LinqService).sql index 472565c042e1..d7273fc9283e 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.LinqService).sql index e6f47aa953c3..1614beebd5da 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.LinqService).sql index 2320c7076da8..ade0640ee06e 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.LinqService).sql index a08df3165dc3..9a2e2229a742 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.LinqService).sql index 13ab88bf98b1..a811288373a8 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.LinqService).sql index 13ab88bf98b1..a811288373a8 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.LinqService).sql index f71061a7e5eb..4d1786d2b511 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.LinqService).sql index f71061a7e5eb..4d1786d2b511 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.LinqService).sql index dd2021c6552d..8e4750c7cddd 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.SA.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.LinqService).sql index 54b1be904f9c..fc26c9084071 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..8a23e3e4a3cd --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..d8b7e70aa286 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..54902b6ad027 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..032e86963737 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..e71980938db5 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..e71980938db5 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..fd0792117ea5 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.LinqService).sql new file mode 100644 index 000000000000..6acaae1e7d64 --- /dev/null +++ b/SqlServer.SA.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.LinqService).sql index 3485279d1576..d6f181e152b4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.LinqService).sql index b0112edf3102..1d1a11e51550 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.LinqService).sql index 07217150b40e..cd23ac6147c4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.SA.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.SA.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 55588a53b7f6..e821208eee34 100644 --- a/SqlServer.SA.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.SA.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.SA SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.LinqService).sql index 409cf47b6d18..f2803ec9598d 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.LinqService).sql index 5551daedd7cd..b288650d0a41 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.LinqService).sql index ceb5ae1d270d..5c6f265d4787 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.LinqService).sql index 18b9999e362b..2951ac618271 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.LinqService).sql index 78d46c242b64..af5a21aff4de 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.LinqService).sql index e67b036c1988..0e172b0cae0c 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.LinqService).sql index 7c3169418f47..b4039597cbc6 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.LinqService).sql index 3b1a00c60311..ae85223c7f0d 100644 --- a/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.LinqService).sql index d988637a9f4c..37ef098acd85 100644 --- a/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.LinqService).sql index d988637a9f4c..37ef098acd85 100644 --- a/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS.EF31/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS.EF8/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql index 031f31d1d27a..dee5cbcc03cb 100644 --- a/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql @@ -6,14 +6,14 @@ SELECT [m_1].[Id], [d_1].[Key_1], - [d_1].[SUM_1], + [d_1].[Sum_1], [d_1].[ToValue] FROM [Parents] [m_1] CROSS APPLY ( SELECT [d].[ParentId] as [Key_1], - SUM([d].[Id]) as [SUM_1], + SUM([d].[Id]) as [Sum_1], STRING_AGG([d].[Name], N', ') as [ToValue] FROM [Children] [d] diff --git a/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql index 7ead679a1527..9879ee375b0d 100644 --- a/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS.EF9/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql @@ -20,7 +20,7 @@ FROM [Issue4629Tags] [a_Tags] WHERE [p].[Id] = [a_Tags].[PostId] - ) as [SUM_1] + ) as [Sum_1] FROM [Issue4629Posts] [p] ) [t1] @@ -34,7 +34,7 @@ FROM [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 ) > 5 ORDER BY - [t1].[SUM_1] + [t1].[Sum_1] ) [id] diff --git a/SqlServer.SA.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..1fa0d34b0804 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.SA.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..c50e9217c8d6 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS.LinqService).sql index 2c3f0472f63d..3fc83e0d5793 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS.LinqService).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS.LinqService).sql index aac6ff86aa93..f9014025f726 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS.LinqService).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS.LinqService,False).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS.LinqService,False).sql index d56b41166fd9..1af1ec1ff97f 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS.LinqService,False).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS.LinqService,False).sql @@ -2,27 +2,23 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS.LinqService).sql index 322887083959..4a4659920286 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS.LinqService).sql index ec5ea2c0f6b6..f3b2e6f6ef68 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS.LinqService).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS.LinqService).sql index 9307f8dfbeb1..9fee65229451 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS.LinqService).sql index b9c16bc93769..e1153a7dcb0c 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS.LinqService).sql index 6bc3507e82e9..ab3b00802fe9 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS.LinqService).sql index 6bc3507e82e9..ab3b00802fe9 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS.LinqService).sql @@ -2,16 +2,16 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS.LinqService).sql index 9fdfdd355062..afbf66bff6f4 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS.LinqService).sql index cf88b2f3cd9b..cd1ad58bf44c 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS.LinqService).sql index e222af9badc0..d7fef176d0bf 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS.LinqService).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS.LinqService).sql index 7a7dcf47ee01..9abc0d09ea5c 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS.LinqService).sql index 5db9afdb9ef5..f3823a7f6a66 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS.LinqService).sql index 5db9afdb9ef5..f3823a7f6a66 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS.LinqService).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS.LinqService).sql index c04f2a517218..4e534346b736 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS.LinqService).sql index c04f2a517218..4e534346b736 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS.LinqService).sql index f34d250b4c96..896a01a4be4d 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS.LinqService).sql index 14a824a1fd2b..105f6e68dafe 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS.LinqService).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..aa59c8966525 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS.LinqService).sql index 847bd3dadab6..6ab920d5fa6b 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS.LinqService).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS.LinqService).sql index a8212f8e2373..cdf1c256c674 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS.LinqService).sql index 219a1f7bc6ce..42b644bbb1e2 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS.LinqService).sql @@ -36,10 +36,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS.LinqService).sql index 0faad4daf5a4..007ab2622ece 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS.LinqService).sql @@ -2,13 +2,13 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS.LinqService).sql index 14e1f61d970e..487672c0bead 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS.LinqService).sql index 30217015aed6..612b91c782f3 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS.LinqService).sql index 19dfc5ab0f85..6b4cd051dfc0 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS.LinqService).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS.LinqService).sql index d28e55600f66..fa1eae9e86e7 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS.LinqService).sql index 9fd8ebb546b3..9bdd877ce4b5 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS.LinqService).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS.LinqService).sql index a6daf34b65b1..10c1440cc094 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS.LinqService).sql @@ -2,87 +2,23 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS.LinqService).sql index 25ccc5377b55..0841e2bfdd67 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS.LinqService).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS.LinqService).sql index 668c81781ee1..7ede5ad6de45 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS.LinqService).sql @@ -2,17 +2,17 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS.LinqService).sql index 8ca14f89ad34..6b84d9f3a39a 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS.LinqService).sql index d41535a9e1b1..b0664bba28c1 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS.LinqService).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS.LinqService).sql index 27b521a4b765..6a55e2487c08 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS.LinqService).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS.LinqService).sql index 58e3908dbe44..aeb62ca25043 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS.LinqService).sql index bbeb69588c3f..8c7afad723a6 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS.LinqService).sql index 801fa78bcc17..ba47d52b2b88 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,1).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,1).sql index bb77c81f8ff9..48ee40d0c066 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,1).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,2).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,2).sql index bb77c81f8ff9..48ee40d0c066 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,2).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,1).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,1).sql index bbeb69588c3f..8c7afad723a6 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,1).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,2).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,2).sql index bbeb69588c3f..8c7afad723a6 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,2).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS.LinqService,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS.LinqService).sql index a4a64fdd32ad..ffb57ce6a939 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS.LinqService).sql index bbeb69588c3f..8c7afad723a6 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS.LinqService).sql index 801fa78bcc17..ba47d52b2b88 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS.LinqService).sql index 8b65069d5142..0853b0e7f956 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS.LinqService).sql index 5f3b0ef7ccee..e8cae8b29def 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS.LinqService).sql index 58e3908dbe44..aeb62ca25043 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS.LinqService).sql index a4a64fdd32ad..ffb57ce6a939 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS.LinqService).sql index 9fe985756598..f40d3f9d338c 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS.LinqService).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS.LinqService).sql index 287e3f1e299b..a2791f656680 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS.LinqService).sql index 287e3f1e299b..a2791f656680 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS.LinqService).sql index d34d380f59c6..932fda7b150d 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS.LinqService).sql index d34d380f59c6..932fda7b150d 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS.LinqService).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS.LinqService).sql index 90b3f893a5b1..6e4d96e8af7f 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS.LinqService).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS.LinqService).sql index f400baba5ef7..7f5ed819acde 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS.LinqService).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..4a119b32b2dc --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,40 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value2], N'') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce([t].[Value3], '') +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) +FROM + [SampleClass] [t] +ORDER BY + [t].[Id] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..5bf533cdd4c2 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..70541b585be7 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..2c14f639f929 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..8298d2e3851f --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..8298d2e3851f --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..0ed6fa29afcc --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.MS.LinqService).sql new file mode 100644 index 000000000000..3d05e69f6015 --- /dev/null +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.MS.LinqService).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS.LinqService).sql index 9cf4268f04fd..a20745203dba 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS.LinqService).sql index 5970bb1428bc..49d9ad70336d 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS.LinqService).sql @@ -7,29 +7,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS.LinqService).sql index 732f0c964ebd..d82ebbff1f70 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS.LinqService).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.SA.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.SA.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 5896885ba9b4..77ff4ccb7951 100644 --- a/SqlServer.SA.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.SA.MS.LinqService/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS.LinqService,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -10,24 +10,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 (asynchronously) diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS.LinqService).sql index 9406ae001a08..9da001978f66 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS.LinqService).sql index 196b546f8aab..9f41c3435ea2 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS.LinqService).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS.LinqService).sql index 087ad70726f4..13a07c724522 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS.LinqService).sql index 0dccbaa99493..d231ac4c359d 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS.LinqService).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS.LinqService).sql index 25a90721f958..683987e23cd5 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS.LinqService).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS.LinqService).sql index eea9a44911a0..47d4ef3ed509 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS.LinqService).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS.LinqService).sql index d0e3ad9ae635..e7283329ab71 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS.LinqService).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS.LinqService).sql index a365c7ac10f8..d2988823d7bd 100644 --- a/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS.LinqService).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS.LinqService).sql index 95bea5750791..8438072c504e 100644 --- a/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS.LinqService).sql index 95bea5750791..8438072c504e 100644 --- a/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS.LinqService).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.SA.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA.MS).sql index 659e8d10b03f..178a8c1f45d5 100644 --- a/SqlServer.SA.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA.MS).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..01c1c76226f3 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA.MS).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.SA.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..0452f6822ef8 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA.MS).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.SA.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS).sql index 5de46945a85e..8276366f6b4c 100644 --- a/SqlServer.SA.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA.MS).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA.MS).sql index bb21705bba38..6abc4a13b633 100644 --- a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA.MS).sql index bb21705bba38..6abc4a13b633 100644 --- a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA.MS).sql index eae6e6cc9273..54b5d46996da 100644 --- a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA.MS).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.SA.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS).sql index abb882f3e500..150e30cbf1cf 100644 --- a/SqlServer.SA.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA.MS).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.SA.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS,False).sql index 378271c7cd3a..6a2b0dde4b21 100644 --- a/SqlServer.SA.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS,False).sql +++ b/SqlServer.SA.MS/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA.MS,False).sql @@ -2,27 +2,23 @@ -- SqlServer.SA.MS SqlServer.2019 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.SA.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS).sql index c16911abb349..667bdc8d7ce6 100644 --- a/SqlServer.SA.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS).sql index ddcbe969ce71..6553c0f51462 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA.MS).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS).sql index c30933adb6ca..5adae742d339 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS).sql index 53a52f235a76..2120c75b1abe 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA.MS).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS).sql index 759a500ac2ab..bbdfa5c6d063 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS).sql index 759a500ac2ab..bbdfa5c6d063 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA.MS).sql @@ -2,16 +2,16 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS).sql index 9639f820440e..1988b90f84de 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS).sql index 0fbb53a858a0..aceb2f5aaad8 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS).sql index 3bf4c9be4f47..38d0686fe254 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA.MS).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS).sql index 4a1b5f24e293..a387b88befc0 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS).sql index c8ccd051fade..cb793ec1cc51 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS).sql index c8ccd051fade..cb793ec1cc51 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA.MS).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS).sql index 52fb0c0e10dc..0102446264ab 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS).sql index c04f2a517218..4e534346b736 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS).sql index e8f549261fa5..7463401e7dc7 100644 --- a/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.SA.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS).sql index 19ff55241815..611e41fad3bd 100644 --- a/SqlServer.SA.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA.MS).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.SA.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..8442c3f0a216 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA.MS).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS).sql index bc5d5daedbf2..3ab307883653 100644 --- a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA.MS).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS).sql index 1feaebcb4aa4..f7df425cd1e0 100644 --- a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS).sql index f500e43756ba..510f60718b95 100644 --- a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA.MS).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS).sql index c62a46500f99..88c0689a61dd 100644 --- a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA.MS).sql @@ -2,13 +2,13 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS).sql index 9b785656f519..d78c1d7a255d 100644 --- a/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA.MS).sql index 631307042bfd..17ba48714580 100644 --- a/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA.MS).sql index 0fcf6918f31d..18b8c80a8dea 100644 --- a/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA.MS).sql @@ -2,7 +2,6 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA.MS).sql index 04eeb23dcf18..220f224ad21f 100644 --- a/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA.MS).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS).sql index 6c4aa173ff41..ecceb5c38ca8 100644 --- a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS).sql index 5c45d51978cd..2a60b4ea835c 100644 --- a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA.MS).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS).sql index c7bb3f957967..7c4abafb1308 100644 --- a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS).sql index 0052bcb6c85e..8c4d6175e025 100644 --- a/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA.MS).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS).sql index 1a4308ea2f59..7358ca88897f 100644 --- a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA.MS).sql @@ -2,87 +2,23 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.SA.MS SqlServer.2019 diff --git a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS).sql index 32a02acb7749..077db9634349 100644 --- a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA.MS).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS).sql index 71719f018dba..98afa461d1e4 100644 --- a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA.MS).sql @@ -2,17 +2,17 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS).sql index 2e877bdea76a..53f5394a03b7 100644 --- a/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS).sql index e07a82861497..a7e59c326f69 100644 --- a/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA.MS).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS).sql index 2e90a6d32a6d..552f3c9ecee8 100644 --- a/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA.MS).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS).sql index 479fd432ffeb..26e34711167c 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS).sql index a375d860d86d..4e9547e66c0c 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS).sql index 7a4dd8745f6b..21bd8940a7c6 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,1).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,1).sql index 2eb80667829b..85ffc449bcab 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,1).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,2).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,2).sql index 2eb80667829b..85ffc449bcab 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,2).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,1).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,1).sql index a375d860d86d..4e9547e66c0c 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,1).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,2).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,2).sql index a375d860d86d..4e9547e66c0c 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,2).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA.MS,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS).sql index e102a5823731..3d03437b5061 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS).sql index a375d860d86d..4e9547e66c0c 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA.MS).sql @@ -2,12 +2,11 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS).sql index 7a4dd8745f6b..21bd8940a7c6 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS).sql index 54cda9d08af3..ef258ea8906d 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS).sql index 8bb3788ca5c9..618f8cc75eae 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS).sql index 479fd432ffeb..26e34711167c 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS).sql index e102a5823731..3d03437b5061 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS).sql index b05b54c2a143..99ddf6216881 100644 --- a/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA.MS).sql @@ -2,9 +2,14 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS).sql index 30e7bc8bfd84..79d53ddbd2ce 100644 --- a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS).sql index 30e7bc8bfd84..79d53ddbd2ce 100644 --- a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS).sql index b670b0dbea55..a4ed73e94629 100644 --- a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS).sql index b670b0dbea55..a4ed73e94629 100644 --- a/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA.MS).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS).sql index bf2fecec5aef..adf9025f0eb9 100644 --- a/SqlServer.SA.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA.MS).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.SA.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS).sql index 7e6624d9c198..9c7cb1d056e3 100644 --- a/SqlServer.SA.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA.MS).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.SA.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.MS).sql index 0f2a563cae51..d1436cec061d 100644 --- a/SqlServer.SA.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.SA.MS SqlServer.2019 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..2e07b2d737c3 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA.MS).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..b84a99dd55d8 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA.MS).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..4be5ae8e8839 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..8298d2e3851f --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..050ebc206d79 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA.MS).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..c12f6e7206fb --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA.MS).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..993abb9b2302 --- /dev/null +++ b/SqlServer.SA.MS/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA.MS).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS).sql index de6f076236ba..d82f3d4e9d87 100644 --- a/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS).sql index 976274b2f730..75a2228f6c73 100644 --- a/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA.MS).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS).sql index e232f5ed7228..5c6c1b4e528b 100644 --- a/SqlServer.SA.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA.MS).sql @@ -2,12 +2,12 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.SA.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.SA.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index f19fcf662f88..26e03f90fe98 100644 --- a/SqlServer.SA.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.SA.MS/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA.MS,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS).sql index 3e550e3bcf76..454678f579b0 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS).sql index 4189cd4a9efd..c6082615c099 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA.MS).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS).sql index 5e5f6051068b..3ef8c76c1952 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA.MS).sql index 5e5f6051068b..3ef8c76c1952 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS).sql index dee3a647a219..7c27f45c5f84 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA.MS).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA.MS).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA.MS).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA.MS).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA.MS).sql index 7a8aefd0d757..e4e60f0499db 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA.MS).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS).sql index 3e12bee21328..907bc847c582 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA.MS).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA.MS).sql index af7c1f434c4c..e58aa161676a 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA.MS).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS).sql index 02011e997958..687ffe68bb76 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA.MS).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS).sql index b865d894c8ed..769eb049a31d 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA.MS).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS).sql index 56bc33f8e170..dd1504b7fce1 100644 --- a/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA.MS).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA.MS).sql index 70b3aa0e74a1..633abfaa8832 100644 --- a/SqlServer.SA.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA.MS).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.SA.MS SqlServer.2019 diff --git a/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS).sql index ddde4e8b9877..54c2529172e7 100644 --- a/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS).sql index ddde4e8b9877..54c2529172e7 100644 --- a/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA.MS).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.SA/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA).sql b/SqlServer.SA/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA).sql index 9ccad8cbe1aa..179aa4410f16 100644 --- a/SqlServer.SA/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/DataProvider/SqlServerTypesTests/Tests.DataProvider.SqlServerTypesTests.TVPCachingIssue(SqlServer.SA).sql @@ -6,23 +6,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -51,23 +46,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -96,23 +86,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction @@ -141,23 +126,18 @@ DECLARE @p [dbo].[TestTableType] -- Structured -- Object SET @p = SELECT - [m_1].[ID], + [m_1].[PersonID], [d].[PersonID] FROM - ( - SELECT DISTINCT - [p].[PersonID] as [ID] + [Person] [m_1] + INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[PersonID] +WHERE + [m_1].[PersonID] IN ( + SELECT + [x].[Id] FROM - [Person] [p] - WHERE - [p].[PersonID] IN ( - SELECT - [x].[Id] - FROM - @p [x] - ) - ) [m_1] - INNER JOIN [Person] [d] ON [d].[PersonID] > [m_1].[ID] + @p [x] + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA).sql b/SqlServer.SA/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA).sql new file mode 100644 index 000000000000..2fba09d29b20 --- /dev/null +++ b/SqlServer.SA/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin1(SqlServer.SA).sql @@ -0,0 +1,10 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + MIN([t1].[ParentID]) +FROM + [Parent] [t1] +WHERE + [t1].[ParentID] < 0 + diff --git a/SqlServer.SA/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA).sql b/SqlServer.SA/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA).sql new file mode 100644 index 000000000000..15776bbdafa1 --- /dev/null +++ b/SqlServer.SA/Tests/Exceptions/AggregationTests/Tests.Exceptions.AggregationTests.NonNullableMin2(SqlServer.SA).sql @@ -0,0 +1,15 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + ( + SELECT + MIN([a_Children].[ParentID]) + FROM + [Child] [a_Children] + WHERE + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ParentID] < 0 + ) +FROM + [Parent] [p] + diff --git a/SqlServer.SA/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA).sql b/SqlServer.SA/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA).sql index 886935095a0c..f6affe4f7b49 100644 --- a/SqlServer.SA/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Extensions/QueryNameTests/Tests.Extensions.QueryNameTests.MainInlineTest(SqlServer.SA).sql @@ -4,12 +4,12 @@ SELECT /* Main */ [p].[ParentID], [p].[Value1], - [t1].[COUNT_1] + [t1].[Count_1] FROM ( SELECT /* Inline */ [c_1].[ParentID], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY diff --git a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA).sql index cc60b0ff30dc..2ad23fc87303 100644 --- a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate1(SqlServer.SA).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA).sql index cc60b0ff30dc..2ad23fc87303 100644 --- a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate2(SqlServer.SA).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA).sql index 43100e195a7c..b3d4b8fcf4e2 100644 --- a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.WindowFunctionWithAggregate3(SqlServer.SA).sql @@ -5,13 +5,13 @@ SET @take = 100 SELECT TOP (@take) [t1].[Key_1], - [t1].[COUNT_1], + [t1].[Count_1], [t1].[window_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], COUNT(*) OVER() as [window_1] FROM [Child] [g_1] diff --git a/SqlServer.SA/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA).sql index c8346e33a581..7120221b6fca 100644 --- a/SqlServer.SA/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CommonTests/Tests.Linq.CommonTests.GroupByUnion1(SqlServer.SA).sql @@ -25,5 +25,5 @@ FROM GROUP BY [tt].[Key_1] HAVING - SUM([tt].[ID]) <> 0 + SUM([tt].[ID]) <> 0 OR SUM([tt].[ID]) IS NULL diff --git a/SqlServer.SA/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA,False).sql b/SqlServer.SA/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA,False).sql index 54f046e4c595..630fd37ad8fc 100644 --- a/SqlServer.SA/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA,False).sql +++ b/SqlServer.SA/Tests/Linq/ContainsTests/Tests.Linq.ContainsTests.AllNullsCEnum(SqlServer.SA,False).sql @@ -2,27 +2,23 @@ -- SqlServer.SA SqlServer.2019 DECLARE @In VarChar(20) -- AnsiString SET @In = NULL -DECLARE @In_1 VarChar(20) -- AnsiString -SET @In_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] IN (@In, @In_1) + [s].[CEnum] IN (@In, @In) BeforeExecute -- SqlServer.SA SqlServer.2019 DECLARE @NotIn VarChar(20) -- AnsiString SET @NotIn = NULL -DECLARE @NotIn_1 VarChar(20) -- AnsiString -SET @NotIn_1 = NULL SELECT COUNT(*) FROM [Src] [s] WHERE - [s].[CEnum] NOT IN (@NotIn, @NotIn_1) + [s].[CEnum] NOT IN (@NotIn, @NotIn) diff --git a/SqlServer.SA/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA).sql index 806da756d2bf..2cd7b00c2b6e 100644 --- a/SqlServer.SA/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/ConvertTests/Tests.Linq.ConvertTests.ByteToString(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - [p].[ID] + CAST(CAST([p].[ID] AS TinyInt) AS NVarChar(3)) FROM [LinqDataTypes] [p] WHERE diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA).sql index f339205b4901..47076619f1c4 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count6(SqlServer.SA).sql @@ -11,7 +11,7 @@ FROM [Child] [g_1] GROUP BY [g_1].[ParentID] - ) [g_2] + ) [t1] WHERE - [g_2].[ParentID] > 2 + [t1].[ParentID] > 2 diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA).sql index ec6c1c32c47e..798f96ff0782 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count8(SqlServer.SA).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 @@ -15,8 +15,8 @@ BeforeExecute SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA).sql index 40051d36d6bf..e8c8b2484b1a 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.Count9(SqlServer.SA).sql @@ -4,8 +4,8 @@ SELECT COUNT(*) FROM - [Child] [p] - INNER JOIN [Parent] [a_Parent] ON [p].[ParentID] = [a_Parent].[ParentID] + [Child] [ch] + INNER JOIN [Parent] [a_Parent] ON [ch].[ParentID] = [a_Parent].[ParentID] WHERE [a_Parent].[ParentID] = 1 diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA).sql index 2328a7c093c9..e452a7896120 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy102(SqlServer.SA).sql @@ -2,16 +2,16 @@ -- SqlServer.SA SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA).sql index 2328a7c093c9..e452a7896120 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupBy5(SqlServer.SA).sql @@ -2,16 +2,16 @@ -- SqlServer.SA SqlServer.2019 SELECT - [g_2].[MAX_1], - [g_2].[COUNT_1] + 1, - [g_2].[COUNT_1], - [g_2].[COUNT_2] + [g_2].[Max_1], + [g_2].[Count_1] + 1, + [g_2].[Count_1], + [g_2].[Count_2] FROM ( SELECT - MAX([g_1].[ChildID]) as [MAX_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1], - COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [COUNT_2] + MAX([g_1].[ChildID]) as [Max_1], + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1], + COUNT(IIF([g_1].[ChildID] > 10, 1, NULL)) as [Count_2] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA).sql index e7e09f963366..4aca5981f26e 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere203(SqlServer.SA).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [COUNT_1] + COUNT(IIF([g_1].[ChildID] > 20, 1, NULL)) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 OR [g_2].[Key_1] > 2 + [g_2].[Count_1] > 2 OR [g_2].[Key_1] > 2 diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA).sql index 579e1d973294..73752474caa4 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere3(SqlServer.SA).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[Key_1] < 5 + [g_2].[Count_1] > 2 AND [g_2].[Key_1] < 5 diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA).sql index a0e32a16d7a2..bc72e04942be 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupByWhere301(SqlServer.SA).sql @@ -7,12 +7,12 @@ FROM ( SELECT [g_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[COUNT_1] > 3 OR [g_2].[Key_1] = 1 + [g_2].[Count_1] > 3 OR [g_2].[Key_1] = 1 diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA).sql index b796dca5dfa3..1e2cb84457e9 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.GroupJoin4(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t2].[COUNT_1] + [t2].[COUNT_1] + [t2].[Count_1] + [t2].[Count_1] FROM ( SELECT @@ -13,7 +13,7 @@ FROM [Child] [c_1] WHERE [t1].[ParentID] = [c_1].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [t1] ) [t2] diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA).sql index 67a2f0aa98bb..de3dd10c2c71 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery2(SqlServer.SA).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA).sql index 67a2f0aa98bb..de3dd10c2c71 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQuery3(SqlServer.SA).sql @@ -13,9 +13,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children_1] WHERE - [p].[ParentID] = [c_1].[ParentID] + [p].[ParentID] = [a_Children_1].[ParentID] )) FROM [Parent] [p] diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA).sql index 217a427d60df..e18460e43ca0 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1(SqlServer.SA).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA).sql index e9d7418c3632..061a957729f6 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax1Async(SqlServer.SA).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 (asynchronously) SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] LEFT JOIN [Parent] [a_Parent] ON [c_1].[ParentID] = [a_Parent].[ParentID] diff --git a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA).sql index 142b8697a078..b17dd8f66391 100644 --- a/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/CountTests/Tests.Linq.CountTests.SubQueryMax2(SqlServer.SA).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 SELECT - MAX([t1].[COUNT_1]) + MAX([t1].[Count_1]) FROM [Parent] [t2] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [a_Children] WHERE diff --git a/SqlServer.SA/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA).sql index 33c915d29615..4bd994f9109b 100644 --- a/SqlServer.SA/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DefaultIfEmptyTests/Tests.Linq.DefaultIfEmptyTests.WithDefaultInSubquery(SqlServer.SA).sql @@ -4,18 +4,22 @@ SELECT ( SELECT - SUM([t1].[ParentID]) + SUM([t2].[ParentID_1]) FROM ( SELECT - IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID] + 1 as [cond], + [d].[ParentID] as [cond_1], + [d].[ChildID], + -100 as [ParentID], + IIF([d].[ParentID] IS NOT NULL, [d].[ParentID], -100) as [ParentID_1] FROM ( SELECT -100 as [ParentID] - ) [c_1] + ) [t1] LEFT JOIN [Child] [d] ON [p].[ParentID] = [d].[ParentID] - ) [t1] + ) [t2] ) FROM [Parent] [p] diff --git a/SqlServer.SA/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA).sql new file mode 100644 index 000000000000..af1f1de35c36 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/DistinctByTests/Tests.Linq.DistinctByTests.DistinctBy(SqlServer.SA).sql @@ -0,0 +1,42 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group_1], + [t1].[Date_1], + [t1].[Amount], + [t1].[IsActive] +FROM + ( + SELECT + ROW_NUMBER() OVER (PARTITION BY [e].[Id], [e].[Name] ORDER BY [e].[Name], [e].[Date] DESC) as [RowNumber], + [e].[Name], + [e].[Date] as [Date_1], + [e].[Id], + [e].[Group] as [Group_1], + [e].[Amount], + [e].[IsActive] + FROM + [TestData] [e] + ) [t1] +WHERE + [t1].[RowNumber] = 1 +ORDER BY + [t1].[Name], + [t1].[Date_1] DESC + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name], + [t1].[Group], + [t1].[Date], + [t1].[Amount], + [t1].[IsActive] +FROM + [TestData] [t1] + diff --git a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA).sql index eae50ec6eb52..960f1dcdf95e 100644 --- a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test1(SqlServer.SA).sql @@ -16,10 +16,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA).sql index dcbdd69eef98..5c82d12769af 100644 --- a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test3(SqlServer.SA).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - [x_1].[SUM_1] + [x_1].[Sum_1] diff --git a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA).sql index ec7953b599eb..c6e04e055918 100644 --- a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.Issue3226Test4(SqlServer.SA).sql @@ -40,10 +40,10 @@ FROM [ItemValue] [a_Values] WHERE [x].[Id] = [a_Values].[ItemId] - ) as [SUM_1] + ) as [Sum_1] FROM [Item] [x] ) [x_1] ORDER BY - Coalesce([x_1].[SUM_1], 0) + Coalesce([x_1].[Sum_1], 0) diff --git a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA).sql index 3c77e3ae64ee..81ca911135a4 100644 --- a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregate(SqlServer.SA).sql @@ -2,13 +2,13 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t3].[SUM_1], - [t6].[COUNT_1] + [t3].[Sum_1], + [t6].[Count_1] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - SUM([t2].[DetailId]) as [SUM_1] + SUM([t2].[DetailId]) as [Sum_1] FROM ( SELECT @@ -29,7 +29,7 @@ FROM ) [t3] OUTER APPLY ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM ( SELECT diff --git a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA).sql index d6fb14a713e0..aad32eeeac6a 100644 --- a/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EagerLoadingTests/Tests.Linq.EagerLoadingTests.TestAggregateAverage(SqlServer.SA).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t3].[AVG_1] + [t3].[Average] FROM [MasterClass] [m_1] OUTER APPLY ( SELECT - AVG(CAST([t2].[DetailId] AS Float)) as [AVG_1] + AVG(CAST([t2].[DetailId] AS Float)) as [Average] FROM ( SELECT diff --git a/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA).sql index 6b79579b4df2..bdbc543c939b 100644 --- a/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithComplexProjection(SqlServer.SA).sql @@ -2,7 +2,6 @@ -- SqlServer.SA SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -17,7 +16,7 @@ FROM LEFT JOIN [SomeStyle] [a_Style] ON [t3].[StyleId] = [a_Style].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 @@ -25,18 +24,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([a_Color].[Name],[t2].[COUNT_1],0,[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0),1,2,3), - (NULL,0,1,[a_Style].[Name],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([a_Color].[Name],[t2].[Count_1],[a_Style].[Name],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0),1,2,3), + (NULL,0,[a_Style].[Name],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 @@ -77,12 +75,12 @@ FROM LEFT JOIN [SomeColor] [a_Color] ON [t3].[ColorId] = [a_Color].[Id] LEFT JOIN ( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] ) [t2] ON 1=1 OUTER APPLY (VALUES - ([a_Color].[Name],[t2].[COUNT_1],IIF([a_Color].[Name] = N'Red', [t2].[COUNT_1], 0)), + ([a_Color].[Name],[t2].[Count_1],IIF([a_Color].[Name] = N'Red', [t2].[Count_1], 0)), (NULL,0,NULL) ) [it]([ColorName], [Count], [Conditional]) WHERE diff --git a/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA).sql index 59ae9a47c703..76a32a38c524 100644 --- a/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithGroupedProjection(SqlServer.SA).sql @@ -2,7 +2,6 @@ -- SqlServer.SA SqlServer.2019 SELECT - [it_1].[cond_1], [it_1].[cond], [it_1].[ColorName], [it_1].[StyleName], @@ -35,18 +34,17 @@ FROM SELECT [it].[ColorName], [it].[Count] as [Count_1], - [it].[index] as [cond], [it].[StyleName], [it].[Conditional], [it].[field1], [it].[field2], [it].[field3], - 1 as [cond_1] + 1 as [cond] FROM (VALUES - ([t1].[ColorName],[t1].[Count_1],0,[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), - (NULL,0,1,[t1].[StyleName],NULL,4,5,6) - ) [it]([ColorName], [Count], [index], [StyleName], [Conditional], [field1], [field2], [field3]) + ([t1].[ColorName],[t1].[Count_1],[t1].[StyleName],IIF([t1].[ColorName] = N'Red', [t1].[Count_1], 0),1,2,3), + (NULL,0,[t1].[StyleName],NULL,4,5,6) + ) [it]([ColorName], [Count], [StyleName], [Conditional], [field1], [field2], [field3]) ) [it_1] WHERE [it_1].[ColorName] = N'Red' OR [it_1].[Count_1] = 0 diff --git a/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA).sql index 659d34c0e34d..69cfeb8a5346 100644 --- a/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/EnumerableInQuery/Tests.Linq.EnumerableInQuery.WithSubqueries(SqlServer.SA).sql @@ -20,7 +20,7 @@ FROM (VALUES ([a_Color].[Name],[a_Style].[Name],( SELECT - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [SomeItem] [t1] )), diff --git a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA).sql index 413b721fd621..ccb5193a0594 100644 --- a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember1(SqlServer.SA).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 0 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 0 ) FROM [Parent] [p] diff --git a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA).sql index 5fef09303ba4..4e31d1b7466b 100644 --- a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember2(SqlServer.SA).sql @@ -6,9 +6,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > 1 + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > 1 ) FROM [Parent] [p] diff --git a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA).sql index c4caa9467aed..d86778721b0f 100644 --- a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MapMember3(SqlServer.SA).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 2 FROM [Parent] [p] diff --git a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA).sql index 0568cabb3abf..adde913f871b 100644 --- a/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/ExpressionsTests/Tests.Linq.ExpressionsTests.MethodExpression4(SqlServer.SA).sql @@ -8,9 +8,9 @@ SELECT SELECT COUNT(*) FROM - [Child] [c_1] + [Child] [a_Children] WHERE - [p].[ParentID] = [c_1].[ParentID] AND [c_1].[ChildID] > @n + [p].[ParentID] = [a_Children].[ParentID] AND [a_Children].[ChildID] > @n ) + 4 FROM [Parent] [p] diff --git a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA).sql index 3dc700d40c5b..4629949aa365 100644 --- a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.CountInGroup(SqlServer.SA).sql @@ -2,87 +2,23 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t1].[Key_1], - [t1].[COUNT_1], - [t1].[COUNT_2], - [t1].[COUNT_3], - [t1].[COUNT_4], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x].[DataValue] - FROM - [AggregationData] [x] - WHERE - [x].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x].[GroupId] - ) [x_1] - WHERE - (Convert(Int, [x_1].[DataValue]) % 2) = 0 - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_1].[DataValue] - FROM - [AggregationData] [t_1] - WHERE - [t_1].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_1].[GroupId] AND - (Convert(Int, [t_1].[DataValue]) % 2) = 0 - ) [t2] - ), - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [x_2].[DataValue] - FROM - [AggregationData] [x_2] - WHERE - [x_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [x_2].[GroupId] AND - (Convert(Int, [x_2].[DataValue]) % 2) = 0 - ) [x_3] - WHERE - (Convert(Int, [x_3].[DataValue]) % 2) = 0 - ), - [t1].[COUNT_5], - ( - SELECT - COUNT(*) - FROM - ( - SELECT DISTINCT - [t_2].[DataValue] - FROM - [AggregationData] [t_2] - WHERE - [t_2].[DataValue] IS NOT NULL AND [t1].[Key_1] = [t_2].[GroupId] AND - (Convert(Int, [t_2].[DataValue]) % 2) = 0 - ) [t3] - ) + [t].[GroupId], + COUNT(*), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(*), + COUNT(DISTINCT [t].[DataValue]), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)), + COUNT(DISTINCT IIF((Convert(Int, [t].[DataValue]) % 2) = 0, [t].[DataValue], NULL)), + COUNT(DISTINCT [t].[DataValue]) FROM - ( - SELECT - [t].[GroupId] as [Key_1], - COUNT(*) as [COUNT_1], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_2], - COUNT(*) as [COUNT_3], - COUNT(DISTINCT [t].[DataValue]) as [COUNT_4], - COUNT(IIF((Convert(Int, [t].[DataValue]) % 2) = 0, 1, NULL)) as [COUNT_5] - FROM - [AggregationData] [t] - WHERE - [t].[DataValue] IS NOT NULL - GROUP BY - [t].[GroupId] - ) [t1] + [AggregationData] [t] +WHERE + [t].[DataValue] IS NOT NULL +GROUP BY + [t].[GroupId] BeforeExecute -- SqlServer.SA SqlServer.2019 diff --git a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA).sql index e4360f0e9e18..4188bae39b62 100644 --- a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.GroupByAssociation2(SqlServer.SA).sql @@ -7,7 +7,7 @@ FROM ( SELECT [a_Parent].[ParentID], - COUNT(*) as [COUNT_1], + COUNT(*) as [Count_1], [a_Parent].[Value1] FROM [GrandChild] [g_1] @@ -17,5 +17,5 @@ FROM [a_Parent].[Value1] ) [g_2] WHERE - [g_2].[COUNT_1] > 2 AND [g_2].[ParentID] <> 1 + [g_2].[Count_1] > 2 AND [g_2].[ParentID] <> 1 diff --git a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA).sql index 41de4b56ee58..090cb49118f6 100644 --- a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar4(SqlServer.SA).sql @@ -2,17 +2,17 @@ -- SqlServer.SA SqlServer.2019 SELECT - [g_2].[MIN_2] + [g_2].[Min_2] FROM ( SELECT - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_2] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1], + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_2] FROM [Child] [g_1] GROUP BY [g_1].[ParentID] ) [g_2] WHERE - [g_2].[MIN_1] IS NOT NULL + [g_2].[Min_1] IS NOT NULL diff --git a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA).sql index 1ae949a39d31..da581bf9fba7 100644 --- a/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/GroupByTests/Tests.Linq.GroupByTests.Scalar41(SqlServer.SA).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 SELECT - [g_2].[MIN_1] + [g_2].[Min_1] FROM ( SELECT MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [cond], - MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [MIN_1] + MIN(IIF([g_1].[ParentID] > 2, [g_1].[ChildID], NULL)) as [Min_1] FROM [Child] [g_1] GROUP BY diff --git a/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA).sql index 15950bf41f1b..b21d74804eeb 100644 --- a/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test1(SqlServer.SA).sql @@ -62,14 +62,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertKey], [al_group_2].[AlertCode], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA).sql index 6240e0492880..bc1b0c9eb280 100644 --- a/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/JoinTests/Tests.Linq.JoinTests.Issue1455Test2(SqlServer.SA).sql @@ -51,14 +51,14 @@ FROM [trade_2].[DealId] as [cond_1], [trade_2].[ParcelId], [trade_2].[CounterParty], - Coalesce([t1].[MAX_1], [t1].[CreationDate]) as [LastUpdate] + [t1].[LastUpdate] FROM ( SELECT [al_group_2].[AlertCode], [al_group_2].[AlertKey], [al_group_2].[CreationDate], - MAX([au_1].[TransactionDate]) as [MAX_1] + Coalesce(MAX([au_1].[TransactionDate]), [al_group_2].[CreationDate]) as [LastUpdate] FROM [Alert] [al_group_2] LEFT JOIN [AuditAlert] [au_1] ON [au_1].[AlertKey] = [al_group_2].[AlertKey] diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA).sql index 760dfa59c171..3f274ee5b8d3 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round1(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA).sql index d7e0b9d72c82..9da47edd0c42 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round10(SqlServer.SA).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA).sql index 4550c7f54ca0..b875ac211d47 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round11(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,1).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,1).sql index 5dd2e6d5d359..4845cbe55518 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,1).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,2).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,2).sql index 5dd2e6d5d359..4845cbe55518 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,2).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,AwayFromZero,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - ROUND([p].[MoneyValue], 1) as [c1], - [p].[MoneyValue] + ROUND([p].[MoneyValue], 1) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,1).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,1).sql index d7e0b9d72c82..9da47edd0c42 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,1).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,1).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,2).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,2).sql index d7e0b9d72c82..9da47edd0c42 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,2).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round12(SqlServer.SA,ToEven,2).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA).sql index 5830e22dfb3d..9a3706d1eedf 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round2(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA).sql index d7e0b9d72c82..9da47edd0c42 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round3(SqlServer.SA).sql @@ -2,12 +2,11 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM ( SELECT - IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1], - [p].[MoneyValue] + IIF([p].[MoneyValue] * 2 = ROUND([p].[MoneyValue] * 2, 1) AND [p].[MoneyValue] <> ROUND([p].[MoneyValue], 1), ROUND([p].[MoneyValue] / 2, 1) * 2, ROUND([p].[MoneyValue], 1)) as [c1] FROM [LinqDataTypes] [p] ) [t] diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA).sql index 4550c7f54ca0..b875ac211d47 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round4(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) * 2 = ROUND(CAST([p].[MoneyValue] AS Float) * 2, 1) AND CAST([p].[MoneyValue] AS Float) <> ROUND(CAST([p].[MoneyValue] AS Float), 1), ROUND(CAST([p].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([p].[MoneyValue] AS Float), 1)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) * 2 = ROUND(CAST([t].[MoneyValue] AS Float) * 2, 1) AND CAST([t].[MoneyValue] AS Float) <> ROUND(CAST([t].[MoneyValue] AS Float), 1), ROUND(CAST([t].[MoneyValue] AS Float) / 2, 1) * 2, ROUND(CAST([t].[MoneyValue] AS Float), 1)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA).sql index 5382623cb21d..55b40b83ae96 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round5(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA).sql index 2a14694c0a11..ea3effb4bed6 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round6(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND(CAST([p].[MoneyValue] AS Float), 0) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND(CAST([t].[MoneyValue] AS Float), 0) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA).sql index 760dfa59c171..3f274ee5b8d3 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round7(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF([p].[MoneyValue] - FLOOR([p].[MoneyValue]) = 0.5 AND (FLOOR([p].[MoneyValue]) % 2) = 0, FLOOR([p].[MoneyValue]), ROUND([p].[MoneyValue], 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF([t].[MoneyValue] - FLOOR([t].[MoneyValue]) = 0.5 AND (FLOOR([t].[MoneyValue]) % 2) = 0, FLOOR([t].[MoneyValue]), ROUND([t].[MoneyValue], 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA).sql index 5830e22dfb3d..9a3706d1eedf 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round8(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + IIF(CAST([p].[MoneyValue] AS Float) - FLOOR(CAST([p].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([p].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([p].[MoneyValue] AS Float)), ROUND(CAST([p].[MoneyValue] AS Float), 0)) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - IIF(CAST([t].[MoneyValue] AS Float) - FLOOR(CAST([t].[MoneyValue] AS Float)) = 0.5 AND (Convert(Int, FLOOR(CAST([t].[MoneyValue] AS Float))) % 2) = 0, FLOOR(CAST([t].[MoneyValue] AS Float)), ROUND(CAST([t].[MoneyValue] AS Float), 0)) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA).sql index 9c8b49b5caf5..b465f3832116 100644 --- a/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/MathFunctionTests/Tests.Linq.MathFunctionTests.Round9(SqlServer.SA).sql @@ -2,9 +2,14 @@ -- SqlServer.SA SqlServer.2019 SELECT - [t].[MoneyValue] + [t].[c1] FROM - [LinqDataTypes] [t] + ( + SELECT + ROUND([p].[MoneyValue], 1) as [c1] + FROM + [LinqDataTypes] [p] + ) [t] WHERE - ROUND([t].[MoneyValue], 1) <> 0 + [t].[c1] <> 0 diff --git a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA).sql index 1ed56693de25..5d5d4741e029 100644 --- a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Ints(SqlServer.SA).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA).sql index 1ed56693de25..5d5d4741e029 100644 --- a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.IntsSql(SqlServer.SA).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 2 + [s].[Int] = 2 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 2 + [s].[Int] <> 2 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] = 4 + [s].[Int] = 4 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[Int] <> 4 + [s].[Int] <> 4 BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -74,7 +74,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE 1 = 0 @@ -84,7 +84,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -102,9 +102,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -112,9 +112,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 2 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 2 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -132,9 +132,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL + [s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -142,9 +142,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableInt] = 4 OR [x].[NullableInt] IS NULL) + NOT ([s].[NullableInt] = 4 OR [s].[NullableInt] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -162,9 +162,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NULL + [s].[NullableInt] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -172,7 +172,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableInt] IS NOT NULL + [s].[NullableInt] IS NOT NULL diff --git a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA).sql index 982d3dcd6586..2d57abed6663 100644 --- a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.Strings(SqlServer.SA).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA).sql index 982d3dcd6586..2d57abed6663 100644 --- a/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/NullIfTests/Tests.Linq.NullIfTests.StringsSql(SqlServer.SA).sql @@ -14,9 +14,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'abc' OR [x].[String] IS NULL + [s].[String] = N'abc' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -24,9 +24,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'abc' OR [x].[String] IS NULL) + NOT ([s].[String] = N'abc' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -44,9 +44,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] = N'xyz' OR [x].[String] IS NULL + [s].[String] = N'xyz' OR [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -54,9 +54,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[String] = N'xyz' OR [x].[String] IS NULL) + NOT ([s].[String] = N'xyz' OR [s].[String] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -74,9 +74,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NULL + [s].[String] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -84,9 +84,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[String] IS NOT NULL + [s].[String] IS NOT NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -104,9 +104,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -114,9 +114,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'abc' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'abc' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -134,9 +134,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL + [s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -144,9 +144,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - NOT ([x].[NullableString] = N'xyz' OR [x].[NullableString] IS NULL) + NOT ([s].[NullableString] = N'xyz' OR [s].[NullableString] IS NULL) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -164,9 +164,9 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NULL + [s].[NullableString] IS NULL BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -174,7 +174,7 @@ BeforeExecute SELECT COUNT(*) FROM - [Src] [x] + [Src] [s] WHERE - [x].[NullableString] IS NOT NULL + [s].[NullableString] IS NOT NULL diff --git a/SqlServer.SA/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA).sql index 64652c2b0074..cf1f87dce9ab 100644 --- a/SqlServer.SA/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/OrderByTests/Tests.Linq.OrderByTests.OrderByContinuous(SqlServer.SA).sql @@ -16,12 +16,12 @@ FROM [Child] [a_Children] WHERE [p].[ParentID] = [a_Children].[ParentID] - ) as [COUNT_1] + ) as [Count_1] FROM [Parent] [p] ) [t1] INNER JOIN [Parent] [pp] ON [t1].[Value1] = [pp].[Value1] ORDER BY [pp].[ParentID], - [t1].[COUNT_1] + [t1].[Count_1] diff --git a/SqlServer.SA/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA).sql index cb2412615d75..130a0cf7c670 100644 --- a/SqlServer.SA/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/SelectQueryTests/Tests.Linq.SelectQueryTests.Select_GroupBy_SelectAgain(SqlServer.SA).sql @@ -9,13 +9,13 @@ SELECT COUNT(*) OVER(), [x].[Key_1], [x].[Count_1], - [x].[MAX_1] + [x].[Max_1] FROM ( SELECT [summary].[LastName] as [Key_1], COUNT(*) as [Count_1], - MAX([summary].[FirstName]) as [MAX_1] + MAX([summary].[FirstName]) as [Max_1] FROM [Person] [summary] GROUP BY diff --git a/SqlServer.SA/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA).sql index 3b180b792685..2041d83ba132 100644 --- a/SqlServer.SA/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/StringFunctionsTests/Tests.Linq.StringFunctionsTests.ConcatStringsTest(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - ISNULL([t].[Value2], '') + Coalesce([t].[Value2], N'') FROM [SampleClass] [t] ORDER BY @@ -12,7 +12,7 @@ BeforeExecute -- SqlServer.SA SqlServer.2019 SELECT - ISNULL([t].[Value3], '') + Coalesce([t].[Value3], '') FROM [SampleClass] [t] ORDER BY @@ -25,6 +25,8 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value1], [t].[Value2]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -33,4 +35,6 @@ SELECT CONCAT_WS(N' -> ', [t].[Value3], [t].[Value3]) FROM [SampleClass] [t] +ORDER BY + [t].[Id] diff --git a/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA).sql new file mode 100644 index 000000000000..b7d7230a92ff --- /dev/null +++ b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNull(SqlServer.SA).sql @@ -0,0 +1,36 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + CONCAT_WS(N', ', [t].[NullableValue], [t].[NotNullableValue], [t].[VarcharValue], [t].[NVarcharValue]), + ( + SELECT + Coalesce(STRING_AGG(Coalesce([t2].[item_1], N''), N', ') WITHIN GROUP (ORDER BY [t2].[item_1]), N'') + FROM + ( + SELECT DISTINCT + [t1].[item] as [item_1] + FROM + (VALUES + ([t].[NullableValue]), ([t].[NotNullableValue]), + ([t].[VarcharValue]), ([t].[NVarcharValue]) + ) [t1]([item]) + WHERE + [t1].[item] IS NOT NULL + ) [t2] + ) +FROM + [SampleClass] [t] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA).sql new file mode 100644 index 000000000000..3b833b521c35 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateArrayNotNullAndFilter(SqlServer.SA).sql @@ -0,0 +1,28 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[c1] +FROM + ( + SELECT + CONCAT_WS(N', ', IIF([t].[NullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NullableValue], NULL), IIF([t].[NotNullableValue] LIKE N'%A%' ESCAPE N'~', [t].[NotNullableValue], NULL), IIF([t].[VarcharValue] LIKE '%A%' ESCAPE N'~', [t].[VarcharValue], NULL), IIF([t].[NVarcharValue] LIKE N'%A%' ESCAPE N'~', [t].[NVarcharValue], NULL)) as [c1] + FROM + [SampleClass] [t] + ) [x] +WHERE + (TRIM(N' + …             

  ' FROM [x].[c1])) <> N'' + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA).sql new file mode 100644 index 000000000000..4fa1b3d935fe --- /dev/null +++ b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullable(SqlServer.SA).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA).sql new file mode 100644 index 000000000000..e71980938db5 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableButFilteredAsync(SqlServer.SA).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 (asynchronously) + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA).sql new file mode 100644 index 000000000000..13f25fdca454 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinAggregateExecuteNullableOnlyNotNull(SqlServer.SA).sql @@ -0,0 +1,8 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + Coalesce(STRING_AGG([t1].[NullableValue], N', ') WITHIN GROUP (ORDER BY [t1].[NotNullableValue]), N'') +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA).sql new file mode 100644 index 000000000000..18efce28b85b --- /dev/null +++ b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGrouping(SqlServer.SA).sql @@ -0,0 +1,26 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [g_1].[Id], + STRING_AGG(Coalesce([g_1].[NullableValue], N''), N', '), + STRING_AGG([g_1].[NotNullableValue], N', ') +FROM + [SampleClass] [g_1] +GROUP BY + [g_1].[Id] +ORDER BY + [g_1].[Id] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA).sql new file mode 100644 index 000000000000..5de661015722 --- /dev/null +++ b/SqlServer.SA/Tests/Linq/StringJoinTests/Tests.Linq.StringJoinTests.JoinWithGroupingAndUnsupportedMethod(SqlServer.SA).sql @@ -0,0 +1,61 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t5].[Key_1], + [t2].[Join_1], + [t4].[Join_1] +FROM + ( + SELECT + [g_1].[Id] as [Key_1] + FROM + [SampleClass] [g_1] + GROUP BY + [g_1].[Id] + ) [t5] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG(Coalesce([t1].[NullableValue], N''), N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x].[NullableValue] + FROM + [SampleClass] [x] + WHERE + [t5].[Key_1] = [x].[Id] + ORDER BY + [x].[NotNullableValue] + ) [t1] + ) [t2] + OUTER APPLY ( + SELECT + Coalesce(STRING_AGG([t3].[NotNullableValue], N', '), N'') as [Join_1] + FROM + ( + SELECT TOP (2) + [x_1].[NotNullableValue] + FROM + [SampleClass] [x_1] + WHERE + [t5].[Key_1] = [x_1].[Id] + ORDER BY + [x_1].[NotNullableValue] + ) [t3] + ) [t4] +ORDER BY + [t5].[Key_1] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[NullableValue], + [t1].[NotNullableValue], + [t1].[VarcharValue], + [t1].[NVarcharValue] +FROM + [SampleClass] [t1] + diff --git a/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA).sql index 4af693ce72f3..07edacdf9fed 100644 --- a/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test1(SqlServer.SA).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA).sql index e4d17faaf1a3..ec2858bb0ce6 100644 --- a/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/SubQueryTests/Tests.Linq.SubQueryTests.Issue4347Test2(SqlServer.SA).sql @@ -9,29 +9,24 @@ SELECT [d].[Amount], [d].[Currency] FROM - ( - SELECT DISTINCT - [x].[Id] + [TransactionEntity] [m_1] + INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] +WHERE + EXISTS( + SELECT + [a_Lines].[Currency] FROM - [TransactionEntity] [x] + [LineEntity] [a_Lines] WHERE - EXISTS( - SELECT - [a_Lines].[Currency] - FROM - [LineEntity] [a_Lines] - WHERE - [x].[Id] = [a_Lines].[TransactionId] - INTERSECT - SELECT - [t1].[item] - FROM - (VALUES - (N'A'), (N'B') - ) [t1]([item]) - ) - ) [m_1] - INNER JOIN [LineEntity] [d] ON [m_1].[Id] = [d].[TransactionId] + [m_1].[Id] = [a_Lines].[TransactionId] + INTERSECT + SELECT + [t1].[item] + FROM + (VALUES + (N'A'), (N'B') + ) [t1]([item]) + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA).sql index 05e298755d0c..fc3978b14458 100644 --- a/SqlServer.SA/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/WhereTests/Tests.Linq.WhereTests.HavingTest3(SqlServer.SA).sql @@ -2,12 +2,12 @@ -- SqlServer.SA SqlServer.2019 SELECT - [g_1].[COUNT_1] + [g_1].[Count_1] FROM ( SELECT [c_1].[ParentID] as [Key_1], - COUNT(*) as [COUNT_1] + COUNT(*) as [Count_1] FROM [Child] [c_1] GROUP BY @@ -16,5 +16,5 @@ FROM [c_1].[ParentID] > 1 ) [g_1] WHERE - [g_1].[Key_1] > 1 AND [g_1].[COUNT_1] > 1 + [g_1].[Key_1] > 1 AND [g_1].[Count_1] > 1 diff --git a/SqlServer.SA/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql b/SqlServer.SA/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql index 298b9b102ea5..741d51b5e7a3 100644 --- a/SqlServer.SA/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql +++ b/SqlServer.SA/Tests/OData/Microsoft/MicrosoftODataTests/Tests.OData.Microsoft.MicrosoftODataTests.Issue3757Test(SqlServer.SA,0x003F$filter=Children0x002Fany(c0x003A contains(c0x002FLS, 'de'))).sql @@ -12,24 +12,18 @@ SELECT [d].[ValB], [d].[ValInt] FROM - ( - SELECT DISTINCT - [l1].[ID], - [l1].[ValS] + [Issue3757Level1] [m_1] + INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] +WHERE + EXISTS( + SELECT + * FROM - [Issue3757Level1] [l1] + [Issue3757Level2] [c_1] WHERE - EXISTS( - SELECT - * - FROM - [Issue3757Level2] [c_1] - WHERE - [l1].[ID] = [c_1].[ParentId] AND [l1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND - [l1].[ValS] IS NOT NULL - ) - ) [m_1] - INNER JOIN [Issue3757Level2] [d] ON [m_1].[ID] = [d].[ParentId] + [m_1].[ID] = [c_1].[ParentId] AND [m_1].[ValS] LIKE @TypedProperty ESCAPE N'~' AND + [m_1].[ValS] IS NOT NULL + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA).sql index 6a37d5eee3ac..03c87ec15818 100644 --- a/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test1(SqlServer.SA).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x_1].[ParentID], [x_1].[CountResult], - [x_1].[SUM_1] + [x_1].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [od_1] WHERE [x].[ParentID] = [od_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [x] ) [x_1] diff --git a/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA).sql index 0e20ff8212d5..a007b7fbc8f7 100644 --- a/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue0082Tests/Tests.UserTests.Issue0082Tests.Test2(SqlServer.SA).sql @@ -36,7 +36,7 @@ BeforeExecute SELECT [x].[ParentID], [x].[CountResult], - [x].[SUM_1] + [x].[Sum_1] FROM ( SELECT @@ -56,7 +56,7 @@ FROM [Child] [a_Children_1] WHERE [o].[ParentID] = [a_Children_1].[ParentID] - ) as [SUM_1] + ) as [Sum_1] FROM [Parent] [o] ) [x] diff --git a/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA).sql index 0878373d2d3b..d08c31774084 100644 --- a/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.NegativeWhereTest(SqlServer.SA).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA).sql index 0878373d2d3b..d08c31774084 100644 --- a/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveHavingTest(SqlServer.SA).sql @@ -9,5 +9,5 @@ FROM GROUP BY [t1].[ParentID] HAVING - SUM([t1].[ParentID]) <> 36 + SUM([t1].[ParentID]) <> 36 OR SUM([t1].[ParentID]) IS NULL diff --git a/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA).sql index 491dba68aa21..108edc4c7b6b 100644 --- a/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue133Tests/Tests.UserTests.Issue133Tests.PositiveWindowFunctionsHavingTest(SqlServer.SA).sql @@ -9,5 +9,5 @@ FROM GROUP BY [g_1].[ParentID] HAVING - SUM([g_1].[ParentID]) <> 36 + SUM([g_1].[ParentID]) <> 36 OR SUM([g_1].[ParentID]) IS NULL diff --git a/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestConnectionStringCopy(SqlServer.SA).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA).sql index ddc971cc9bbc..a0a2f5912517 100644 --- a/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue1486Tests/Tests.UserTests.Issue1486Tests.TestFactory(SqlServer.SA).sql @@ -9,16 +9,11 @@ SELECT [d].[ChildID] FROM ( - SELECT DISTINCT - [t2].[ParentID] + SELECT TOP (1) + [a_Parent].[ParentID] FROM - ( - SELECT TOP (1) - [a_Parent].[ParentID] - FROM - [Child] [t1] - LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] - ) [t2] + [Child] [t1] + LEFT JOIN [Parent] [a_Parent] ON [t1].[ParentID] = [a_Parent].[ParentID] ) [m_1] INNER JOIN [Child] [d] ON [m_1].[ParentID] = [d].[ParentID] diff --git a/SqlServer.SA/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA).sql index 1474ee9e3a10..a636655971eb 100644 --- a/SqlServer.SA/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue4254Tests/Tests.UserTests.Issue4254Tests.VerifyParameterNameIsCorrect(SqlServer.SA).sql @@ -59,35 +59,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction @@ -140,35 +135,30 @@ DECLARE @now DateTime2 SET @now = DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1230000, 7) SELECT - [m_1].[Id], + [m_1].[id], [d].[category_id] FROM - ( - SELECT DISTINCT - [x].[id] as [Id] + [issue_4254_media_items] [m_1] + INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[id] = [d].[media_item_id] +WHERE + EXISTS( + SELECT + * + FROM + [issue_4254_media_item_user_share] [y] + WHERE + [m_1].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND + [y].[expires_at] > @now + ) OR + EXISTS( + SELECT + * FROM - [issue_4254_media_items] [x] + [issue_4254_media_item_user_share] [y_1] WHERE - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y] - WHERE - [x].[id] = [y].[media_item_id] AND [y].[user_id] = @userId AND - [y].[expires_at] > @now - ) OR - EXISTS( - SELECT - * - FROM - [issue_4254_media_item_user_share] [y_1] - WHERE - [x].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND - [y_1].[expires_at] > @now - ) - ) [m_1] - INNER JOIN [issue_4254_media_item_to_media_item_categories] [d] ON [m_1].[Id] = [d].[media_item_id] + [m_1].[id] = [y_1].[media_item_id] AND [y_1].[created_by_id] = @userId AND + [y_1].[expires_at] > @now + ) BeforeExecute DisposeTransaction diff --git a/SqlServer.SA/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA).sql index bb93fd78b73a..6b932b4eee43 100644 --- a/SqlServer.SA/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue4336Tests/Tests.UserTests.Issue4336Tests.Issue4336Test(SqlServer.SA).sql @@ -20,7 +20,7 @@ FROM [vpc].[CategoryId], [pop].[ProductId], COALESCE([pcc].[PeriodOrderLimit],0) as [MaxCapacity], - COALESCE(COALESCE([vsp].[SUM_1],0),0) as [Quantity] + COALESCE(COALESCE([vsp].[Quantity],0),0) as [Quantity] FROM [OrderPeriod] [op] INNER JOIN [ProductsPerOrderPeriod] [pop] ON [op].[Id] = [pop].[OrderPeriodId] @@ -30,7 +30,7 @@ FROM SELECT [agroup].[Id], [oi].[ProductId], - SUM(COALESCE([oi].[Quantity],0)) as [SUM_1] + SUM(COALESCE([oi].[Quantity],0)) as [Quantity] FROM [OrderPeriod] [agroup] LEFT JOIN [OrderHeader] [oh] ON [agroup].[Id] = [oh].[PeriodId] diff --git a/SqlServer.SA/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA).sql index 45f8a9b6bf28..cd592560906b 100644 --- a/SqlServer.SA/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue5100Tests/Tests.UserTests.Issue5100Tests.LinqToSqlNotPossible(SqlServer.SA).sql @@ -90,7 +90,7 @@ FROM [LanguageDTO] [l] WHERE [l].[AlternativeLanguageID] = [t1].[LanguageId] - ) as [COUNT_1], + ) as [Count_1], ( SELECT [t].[ServerOnlyText] @@ -103,6 +103,6 @@ FROM [TextTranslationDTO] [t1] ) [t2] ORDER BY - [t2].[COUNT_1], + [t2].[Count_1], [t2].[ServerOnlyText] diff --git a/SqlServer.SA/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA).sql index b8c7928ce451..c5f7fbc1dff1 100644 --- a/SqlServer.SA/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue873Tests/Tests.UserTests.Issue873Tests.Test(SqlServer.SA).sql @@ -3,7 +3,7 @@ SELECT N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)), - [t2].[SUM_1], + [t2].[SubSum], IIF(EXISTS( SELECT * @@ -32,6 +32,7 @@ FROM FROM ( SELECT + [c_1].[ParentID], [c_1].[ChildID] FROM [Child] [c_1] @@ -39,12 +40,12 @@ FROM WHERE [a_Parent].[ParentID] = [f].[ParentID] AND ([a_Parent].[Value1] = [f].[Value1] OR [a_Parent].[Value1] IS NULL AND [f].[Value1] IS NULL) ) [t1] - ) as [SUM_1], + ) as [SubSum], [f].[ParentID] FROM [Parent] [f] ) [t2] WHERE N' ' + CAST(Coalesce([t2].[Value1], 0) AS NVarChar(11)) LIKE N'%1%' ESCAPE N'~' AND - [t2].[SUM_1] > 0 + [t2].[SubSum] > 0 diff --git a/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA).sql index 66614c32494e..31c770f3b01e 100644 --- a/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test2(SqlServer.SA).sql @@ -5,13 +5,13 @@ SELECT [p1].[ParentID], [p1].[Value1], [p2].[Key_1], - [p2].[SUM_1] + [p2].[Sum_1] FROM [Parent] [p1] INNER JOIN ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA).sql index 4ae67a444ca8..fc6a12e5e3f6 100644 --- a/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/Issue928Tests/Tests.UserTests.Issue928Tests.Test4(SqlServer.SA).sql @@ -3,14 +3,14 @@ SELECT [t1].[Key_1], - [t1].[SUM_1], + [t1].[Sum_1], [p2].[Key_1], [p2].[Sum_1] FROM ( SELECT [g_1].[ParentID] as [Key_1], - SUM([g_1].[ParentID]) as [SUM_1] + SUM([g_1].[ParentID]) as [Sum_1] FROM [Parent] [g_1] WHERE diff --git a/SqlServer.SA/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA).sql index ad3ee4abd055..f9878e16b06e 100644 --- a/SqlServer.SA/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/UserTests/VeryLongRunning/Tests/Tests.UserTests.VeryLongRunning.Tests.Test(SqlServer.SA).sql @@ -193,35 +193,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -237,8 +246,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.SA SqlServer.2019 @@ -1434,35 +1441,44 @@ SELECT [t].[Column1], CASE WHEN [r].[Column4] IS NOT NULL THEN [r].[Column4] - WHEN [i].[Column8] IS NULL AND ([rd].[Column4] IS NOT NULL OR [rd2].[Column4] IS NOT NULL) - THEN IIF([rd].[Column4] IS NOT NULL, [rd].[Column4], [rd2].[Column4]) + WHEN [i].[Column8] IS NULL AND ([i].[Column4] IS NOT NULL OR [i].[Column4_1] IS NOT NULL) + THEN IIF([i].[Column4] IS NOT NULL, [i].[Column4], [i].[Column4_1]) ELSE [i].[Column8] END FROM - [tempdb]..[#tbl9999] [i] - LEFT JOIN ( - SELECT - [g_1].[Column3] as [Key_1], - MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_1] - WHERE - [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND - [g_1].[Column3] IS NOT NULL - GROUP BY - [g_1].[Column3] - ) [rd] ON [i].[Column2] = [rd].[Key_1] OR [i].[Column2] IS NULL AND [rd].[Key_1] IS NULL - LEFT JOIN ( - SELECT - MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) as [Column4] - FROM - [tempdb]..[#tbl1515] [g_2] - WHERE - [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND - [g_2].[Column3] IS NULL - GROUP BY - [g_2].[Column3] - ) [rd2] ON 1=1 + ( + SELECT + [id].[Column1], + [id].[Column8], + [rd].[Column4], + ( + SELECT + MIN(IIF([g_2].[Column2] = 1, [g_2].[Column6], NULL)) + FROM + [tempdb]..[#tbl1515] [g_2] + WHERE + [g_2].[Column4] <= @date AND ([g_2].[Column5] IS NULL OR [g_2].[Column5] > @date) AND + [g_2].[Column3] IS NULL + GROUP BY + [g_2].[Column3] + ) as [Column4_1] + FROM + [tempdb]..[#tbl9999] [id] + LEFT JOIN ( + SELECT + [g_1].[Column3] as [Key_1], + MIN(IIF([g_1].[Column2] = 1, [g_1].[Column6], NULL)) as [Column4] + FROM + [tempdb]..[#tbl1515] [g_1] + WHERE + [g_1].[Column4] <= @date AND ([g_1].[Column5] IS NULL OR [g_1].[Column5] > @date) AND + [g_1].[Column3] IS NOT NULL + GROUP BY + [g_1].[Column3] + ) [rd] ON [id].[Column2] = [rd].[Key_1] OR [id].[Column2] IS NULL AND [rd].[Key_1] IS NULL + WHERE + [id].[Column4] <= @date AND ([id].[Column5] IS NULL OR [id].[Column5] > @date) + ) [i] LEFT JOIN ( SELECT [g_3].[Column2] as [Key_1], @@ -1478,8 +1494,6 @@ FROM [g_3].[Column2] ) [r] ON [i].[Column1] = [r].[Key_1] INNER JOIN [tempdb]..[#tbl1414] [t] ON [i].[Column1] = [t].[Column1] -WHERE - [i].[Column4] <= @date AND ([i].[Column5] IS NULL OR [i].[Column5] > @date) BeforeExecute -- SqlServer.SA SqlServer.2019 diff --git a/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA).sql b/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA).sql index 98a4194aa504..b75f5b41e068 100644 --- a/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330Test(SqlServer.SA).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1 diff --git a/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA).sql b/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA).sql index 98a4194aa504..b75f5b41e068 100644 --- a/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/xUpdate/UpdateFromTests/Tests.xUpdate.UpdateFromTests.Issue2330TestOld(SqlServer.SA).sql @@ -11,9 +11,9 @@ FROM WHERE [b].[ChildID] = ( SELECT - MAX([b2].[ParentID]) + MAX([t1].[ParentID]) FROM - [Child] [b2] + [Child] [t1] ) AND [b].[ChildID] = -1