Skip to content

Commit

Permalink
Update baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ranma42 committed Jul 4, 2024
1 parent adc3cd4 commit 79e3de6
Show file tree
Hide file tree
Showing 20 changed files with 117 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ FROM [Customers] AS [c]
SELECT TOP(1) (
SELECT TOP(1) [o0].[CustomerID]
FROM [Orders] AS [o0]
WHERE [o].[CustomerID] = [o0].[CustomerID] OR ([o].[CustomerID] IS NULL AND [o0].[CustomerID] IS NULL))
WHERE [o].[CustomerID] IS DISTINCT FROM [o0].[CustomerID])
FROM [Orders] AS [o]
GROUP BY [o].[CustomerID]
HAVING COUNT(*) > 11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ public override async Task Aggregate_over_subquery_in_group_by_projection_2(bool
SELECT [t].[Value] AS [A], (
SELECT MAX([t0].[Id])
FROM [Tables] AS [t0]
WHERE [t0].[Value] = MAX([t].[Id]) * 6 OR ([t0].[Value] IS NULL AND MAX([t].[Id]) IS NULL)) AS [B]
WHERE [t0].[Value] IS DISTINCT FROM MAX([t].[Id]) * 6) AS [B]
FROM [Tables] AS [t]
GROUP BY [t].[Value]
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public override async Task Self_reference_in_query_filter_works()
FROM [EntitiesWithQueryFilterSelfReference] AS [e]
WHERE EXISTS (
SELECT 1
FROM [EntitiesWithQueryFilterSelfReference] AS [e0]) AND ([e].[Name] <> N'Foo' OR [e].[Name] IS NULL)
FROM [EntitiesWithQueryFilterSelfReference] AS [e0]) AND [e].[Name] IS NOT DISTINCT FROM N'Foo'
""",
//
"""
Expand All @@ -225,7 +225,7 @@ SELECT 1
FROM [EntitiesWithQueryFilterSelfReference] AS [e0]
WHERE EXISTS (
SELECT 1
FROM [EntitiesWithQueryFilterSelfReference] AS [e1])) AND ([e].[Name] <> N'Foo' OR [e].[Name] IS NULL)
FROM [EntitiesWithQueryFilterSelfReference] AS [e1])) AND [e].[Name] IS NOT DISTINCT FROM N'Foo'
""");
}

Expand All @@ -239,15 +239,15 @@ public override async Task Invoke_inside_query_filter_gets_correctly_evaluated_d

SELECT [e].[Id], [e].[Name], [e].[TenantId]
FROM [Entities] AS [e]
WHERE ([e].[Name] <> N'Foo' OR [e].[Name] IS NULL) AND [e].[TenantId] = @__ef_filter__p_0
WHERE [e].[Name] IS NOT DISTINCT FROM N'Foo' AND [e].[TenantId] = @__ef_filter__p_0
""",
//
"""
@__ef_filter__p_0='2'

SELECT [e].[Id], [e].[Name], [e].[TenantId]
FROM [Entities] AS [e]
WHERE ([e].[Name] <> N'Foo' OR [e].[Name] IS NULL) AND [e].[TenantId] = @__ef_filter__p_0
WHERE [e].[Name] IS NOT DISTINCT FROM N'Foo' AND [e].[TenantId] = @__ef_filter__p_0
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3596,19 +3596,7 @@ FROM [LevelThree] AS [l1]
ORDER BY [l1].[Id])
FROM [LevelTwo] AS [l0]
WHERE [l0].[Level1_Optional_Id] = [l].[Id]
ORDER BY [l0].[Id]) <> N'Foo' OR (
SELECT TOP(1) (
SELECT TOP(1) (
SELECT TOP(1) [l2].[Name]
FROM [LevelFour] AS [l2]
WHERE [l2].[Level3_Required_Id] = [l1].[Id]
ORDER BY [l2].[Id])
FROM [LevelThree] AS [l1]
WHERE [l1].[Level2_Required_Id] = [l0].[Id]
ORDER BY [l1].[Id])
FROM [LevelTwo] AS [l0]
WHERE [l0].[Level1_Optional_Id] = [l].[Id]
ORDER BY [l0].[Id]) IS NULL
ORDER BY [l0].[Id]) IS NOT DISTINCT FROM N'Foo'
ORDER BY [l].[Id]
""");
}
Expand Down Expand Up @@ -3926,7 +3914,7 @@ WHEN EXISTS (
SELECT 1
FROM [LevelOne] AS [l1]
LEFT JOIN [LevelTwo] AS [l2] ON [l1].[Id] = [l2].[Level1_Optional_Id]
WHERE [l2].[Name] = [l0].[Name] OR ([l2].[Name] IS NULL AND [l0].[Name] IS NULL)) THEN CAST(1 AS bit)
WHERE [l2].[Name] IS DISTINCT FROM [l0].[Name]) THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [Contains]
FROM [LevelOne] AS [l]
Expand All @@ -3945,7 +3933,7 @@ WHEN EXISTS (
SELECT 1
FROM [LevelOne] AS [l2]
LEFT JOIN [LevelTwo] AS [l3] ON [l2].[Id] = [l3].[Level1_Optional_Id]
WHERE [l3].[Id] = [l1].[Id] OR ([l3].[Id] IS NULL AND [l1].[Id] IS NULL)) THEN CAST(1 AS bit)
WHERE [l3].[Id] IS DISTINCT FROM [l1].[Id]) THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [Contains]
FROM [LevelOne] AS [l]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ WHERE [l9].[OneToOne_Required_PK_Date] IS NOT NULL AND [l9].[Level1_Required_Id]
) AS [l10] ON [l4].[Id] = CASE
WHEN [l10].[OneToOne_Required_PK_Date] IS NOT NULL AND [l10].[Level1_Required_Id] IS NOT NULL AND [l10].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l10].[Id]
END
WHERE [l3].[Level3_Name] = [l7].[Level3_Name] OR ([l3].[Level3_Name] IS NULL AND [l7].[Level3_Name] IS NULL)) > 0
WHERE [l3].[Level3_Name] IS DISTINCT FROM [l7].[Level3_Name]) > 0
""");
}

Expand Down Expand Up @@ -471,11 +471,9 @@ WHEN [l5].[Level2_Required_Id] IS NOT NULL AND [l5].[OneToMany_Required_Inverse3
END
WHERE [l3].[Level3_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse4Id] IS NOT NULL AND CASE
WHEN [l2].[Level2_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse3Id] IS NOT NULL THEN [l2].[Id]
END IS NOT NULL AND (CASE
WHEN [l2].[Level2_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse3Id] IS NOT NULL THEN [l2].[Id]
END = [l3].[OneToMany_Optional_Inverse4Id] OR (CASE
END IS NOT NULL AND CASE
WHEN [l2].[Level2_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse3Id] IS NOT NULL THEN [l2].[Id]
END IS NULL AND [l3].[OneToMany_Optional_Inverse4Id] IS NULL))
END IS DISTINCT FROM [l3].[OneToMany_Optional_Inverse4Id]
) AS [s]
WHERE [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL AND [l].[Id] = [l0].[OneToMany_Optional_Inverse2Id]
) AS [s0]
Expand Down Expand Up @@ -568,7 +566,7 @@ WHERE [l9].[OneToOne_Required_PK_Date] IS NOT NULL AND [l9].[Level1_Required_Id]
) AS [l10] ON [l4].[Id] = CASE
WHEN [l10].[OneToOne_Required_PK_Date] IS NOT NULL AND [l10].[Level1_Required_Id] IS NOT NULL AND [l10].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l10].[Id]
END
WHERE [l3].[Level3_Name] = [l7].[Level3_Name] OR ([l3].[Level3_Name] IS NULL AND [l7].[Level3_Name] IS NULL)) > 0
WHERE [l3].[Level3_Name] IS DISTINCT FROM [l7].[Level3_Name]) > 0
""");
}

Expand Down Expand Up @@ -903,7 +901,7 @@ WHERE [l6].[OneToOne_Required_PK_Date] IS NOT NULL AND [l6].[Level1_Required_Id]
) AS [l7] ON [s0].[Id] = CASE
WHEN [l7].[OneToOne_Required_PK_Date] IS NOT NULL AND [l7].[Level1_Required_Id] IS NOT NULL AND [l7].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l7].[Id]
END
WHERE [s].[Key] = [s0].[Key] OR ([s].[Key] IS NULL AND [s0].[Key] IS NULL)) AS [Sum]
WHERE [s].[Key] IS DISTINCT FROM [s0].[Key]) AS [Sum]
FROM (
SELECT CASE
WHEN [l2].[OneToOne_Required_PK_Date] IS NOT NULL AND [l2].[Level1_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l2].[Id]
Expand Down Expand Up @@ -957,7 +955,7 @@ WHERE [l6].[OneToOne_Required_PK_Date] IS NOT NULL AND [l6].[Level1_Required_Id]
) AS [l7] ON [s0].[Id] = CASE
WHEN [l7].[OneToOne_Required_PK_Date] IS NOT NULL AND [l7].[Level1_Required_Id] IS NOT NULL AND [l7].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l7].[Id]
END
WHERE [s].[Key] = [s0].[Key] OR ([s].[Key] IS NULL AND [s0].[Key] IS NULL)) AS [Sum]
WHERE [s].[Key] IS DISTINCT FROM [s0].[Key]) AS [Sum]
FROM (
SELECT CASE
WHEN [l2].[OneToOne_Required_PK_Date] IS NOT NULL AND [l2].[Level1_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l2].[Id]
Expand Down Expand Up @@ -997,13 +995,9 @@ WHERE [l5].[OneToOne_Required_PK_Date] IS NOT NULL AND [l5].[Level1_Required_Id]
) AS [l6] ON [l4].[Id] = [l6].[Level1_Optional_Id]
WHERE CASE
WHEN [l6].[OneToOne_Required_PK_Date] IS NOT NULL AND [l6].[Level1_Required_Id] IS NOT NULL AND [l6].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l6].[Id]
END = CASE
WHEN [l3].[OneToOne_Required_PK_Date] IS NOT NULL AND [l3].[Level1_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l3].[Id]
END OR (CASE
WHEN [l6].[OneToOne_Required_PK_Date] IS NOT NULL AND [l6].[Level1_Required_Id] IS NOT NULL AND [l6].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l6].[Id]
END IS NULL AND CASE
END IS DISTINCT FROM CASE
WHEN [l3].[OneToOne_Required_PK_Date] IS NOT NULL AND [l3].[Level1_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l3].[Id]
END IS NULL)) THEN CAST(1 AS bit)
END) THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [Contains]
FROM [Level1] AS [l]
Expand Down Expand Up @@ -1269,7 +1263,7 @@ LEFT JOIN (
FROM [Level1] AS [l3]
WHERE [l3].[OneToOne_Required_PK_Date] IS NOT NULL AND [l3].[Level1_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse2Id] IS NOT NULL
) AS [l4] ON [l2].[Id] = [l4].[Level1_Optional_Id]
WHERE [l4].[Level2_Name] = [l1].[Level2_Name] OR ([l4].[Level2_Name] IS NULL AND [l1].[Level2_Name] IS NULL)) THEN CAST(1 AS bit)
WHERE [l4].[Level2_Name] IS DISTINCT FROM [l1].[Level2_Name]) THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [Contains]
FROM [Level1] AS [l]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,13 @@ public override async Task Whats_new_2021_sample_5(bool async)
SELECT (
SELECT TOP(1) [p0].[LastName]
FROM [Person] AS [p0]
WHERE [p].[FirstName] = [p0].[FirstName] OR ([p].[FirstName] IS NULL AND [p0].[FirstName] IS NULL))
WHERE [p].[FirstName] IS DISTINCT FROM [p0].[FirstName])
FROM [Person] AS [p]
GROUP BY [p].[FirstName]
ORDER BY (
SELECT TOP(1) [p0].[LastName]
FROM [Person] AS [p0]
WHERE [p].[FirstName] = [p0].[FirstName] OR ([p].[FirstName] IS NULL AND [p0].[FirstName] IS NULL))
WHERE [p].[FirstName] IS DISTINCT FROM [p0].[FirstName])
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6061,7 +6061,7 @@ public override async Task String_compare_with_null_conditional_argument(bool as
FROM [Weapons] AS [w]
LEFT JOIN [Weapons] AS [w0] ON [w].[SynergyWithId] = [w0].[Id]
ORDER BY CASE
WHEN [w0].[Name] = N'Marcus'' Lancer' AND [w0].[Name] IS NOT NULL THEN CAST(1 AS bit)
WHEN [w0].[Name] IS DISTINCT FROM N'Marcus'' Lancer' THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END
""");
Expand All @@ -6077,7 +6077,7 @@ public override async Task String_compare_with_null_conditional_argument2(bool a
FROM [Weapons] AS [w]
LEFT JOIN [Weapons] AS [w0] ON [w].[SynergyWithId] = [w0].[Id]
ORDER BY CASE
WHEN N'Marcus'' Lancer' = [w0].[Name] AND [w0].[Name] IS NOT NULL THEN CAST(1 AS bit)
WHEN N'Marcus'' Lancer' IS DISTINCT FROM [w0].[Name] THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END
""");
Expand Down Expand Up @@ -6783,7 +6783,7 @@ LEFT JOIN (
FROM [Gears] AS [g0]
) AS [g1]
WHERE [g1].[row] <= 50
) AS [g2] ON ([g].[Nickname] = [g2].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g2].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g2].[LeaderSquadId]
) AS [g2] ON [g].[Nickname] IS DISTINCT FROM [g2].[LeaderNickname] AND [g].[SquadId] = [g2].[LeaderSquadId]
WHERE [g].[Discriminator] = N'Officer'
ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId], [g2].[Nickname]
""");
Expand All @@ -6798,7 +6798,7 @@ public override async Task Project_collection_navigation_nested_composite_key(bo
SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank]
FROM [Tags] AS [t]
LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId]
LEFT JOIN [Gears] AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId]
LEFT JOIN [Gears] AS [g0] ON [g].[Nickname] IS DISTINCT FROM [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]
WHERE [g].[Discriminator] = N'Officer'
ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId], [g0].[Nickname]
""");
Expand Down Expand Up @@ -7003,7 +7003,7 @@ public override async Task Navigation_based_on_complex_expression6(bool async)
AssertSql(
"""
SELECT CASE
WHEN [l2].[Name] = N'Queen Myrrah' AND [l2].[Name] IS NOT NULL THEN CAST(1 AS bit)
WHEN [l2].[Name] IS DISTINCT FROM N'Queen Myrrah' THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END, [l2].[Name], [l2].[Discriminator], [l2].[LocustHordeId], [l2].[ThreatLevel], [l2].[ThreatLevelByte], [l2].[ThreatLevelNullableByte], [l2].[DefeatedByNickname], [l2].[DefeatedBySquadId], [l2].[HighCommandId], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId]
FROM [Factions] AS [f]
Expand Down Expand Up @@ -7070,7 +7070,7 @@ public override async Task Nullable_bool_comparison_is_translated_to_server(bool
AssertSql(
"""
SELECT CASE
WHEN [f].[Eradicated] = CAST(1 AS bit) AND [f].[Eradicated] IS NOT NULL THEN CAST(1 AS bit)
WHEN [f].[Eradicated] IS DISTINCT FROM CAST(1 AS bit) THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [IsEradicated]
FROM [Factions] AS [f]
Expand Down Expand Up @@ -8001,7 +8001,7 @@ FROM [LocustLeaders] AS [l]
WHERE EXISTS (
SELECT 1
FROM [LocustLeaders] AS [l0]
WHERE [l0].[ThreatLevelNullableByte] = [l].[ThreatLevelNullableByte] OR ([l0].[ThreatLevelNullableByte] IS NULL AND [l].[ThreatLevelNullableByte] IS NULL))
WHERE [l0].[ThreatLevelNullableByte] IS DISTINCT FROM [l].[ThreatLevelNullableByte])
""");
}

Expand Down Expand Up @@ -8102,7 +8102,7 @@ FROM [Gears] AS [g]
WHERE EXISTS (
SELECT 1
FROM [LocustLeaders] AS [l0]
WHERE [l0].[ThreatLevelNullableByte] = [l].[ThreatLevelNullableByte] OR ([l0].[ThreatLevelNullableByte] IS NULL AND [l].[ThreatLevelNullableByte] IS NULL))
WHERE [l0].[ThreatLevelNullableByte] IS DISTINCT FROM [l].[ThreatLevelNullableByte])
) AS [g0]
""");
}
Expand All @@ -8121,7 +8121,7 @@ FROM [Gears] AS [g]
WHERE NOT EXISTS (
SELECT 1
FROM [LocustLeaders] AS [l0]
WHERE [l0].[ThreatLevelNullableByte] = [l].[ThreatLevelNullableByte] OR ([l0].[ThreatLevelNullableByte] IS NULL AND [l].[ThreatLevelNullableByte] IS NULL))
WHERE [l0].[ThreatLevelNullableByte] IS DISTINCT FROM [l].[ThreatLevelNullableByte])
) AS [g0]
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ SELECT CASE
WHEN NOT EXISTS (
SELECT 1
FROM [Orders] AS [o]
WHERE [o].[CustomerID] <> N'ALFKI' OR [o].[CustomerID] IS NULL) THEN CAST(1 AS bit)
WHERE [o].[CustomerID] IS NOT DISTINCT FROM N'ALFKI') THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END
""");
Expand Down Expand Up @@ -2552,7 +2552,7 @@ ELSE CAST(0 AS bit)
WHEN EXISTS (
SELECT 1
FROM [Orders] AS [o1]
WHERE ([o1].[CustomerID] <> N'VINET' OR [o1].[CustomerID] IS NULL) AND [o1].[EmployeeID] IS NULL) THEN CAST(1 AS bit)
WHERE [o1].[CustomerID] IS NOT DISTINCT FROM N'VINET' AND [o1].[EmployeeID] IS NULL) THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,7 @@ WHEN NOT EXISTS (
SELECT 1
FROM [Orders] AS [o]
GROUP BY [o].[CustomerID]
HAVING [o].[CustomerID] <> N'ALFKI' OR [o].[CustomerID] IS NULL) THEN CAST(1 AS bit)
HAVING [o].[CustomerID] IS NOT DISTINCT FROM N'ALFKI') THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ SELECT TOP(@__p_0) [m].[City], [m].[ContactName]
WHERE EXISTS (
SELECT 1
FROM [Customers] AS [c]
WHERE [c].[City] = [m].[City] OR ([c].[City] IS NULL AND [m].[City] IS NULL))
WHERE [c].[City] IS DISTINCT FROM [m].[City])
ORDER BY [m].[ContactName]
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ FROM [Employees] AS [e]
WHERE (
SELECT TOP(1) [e0].[EmployeeID]
FROM [Employees] AS [e0]
WHERE [e0].[EmployeeID] <> [e].[ReportsTo] OR [e].[ReportsTo] IS NULL) = 0
WHERE [e0].[EmployeeID] IS NOT DISTINCT FROM [e].[ReportsTo]) = 0
""");
}

Expand All @@ -702,7 +702,7 @@ FROM [Employees] AS [e]
WHERE (
SELECT TOP(1) [e0].[EmployeeID]
FROM [Employees] AS [e0]
WHERE [e0].[EmployeeID] <> [e].[ReportsTo] OR [e].[ReportsTo] IS NULL) = 0
WHERE [e0].[EmployeeID] IS NOT DISTINCT FROM [e].[ReportsTo]) = 0
""");
}

Expand All @@ -717,7 +717,7 @@ FROM [Employees] AS [e]
WHERE (
SELECT TOP(1) [e0].[EmployeeID]
FROM [Employees] AS [e0]
WHERE [e0].[EmployeeID] <> [e].[ReportsTo] OR [e].[ReportsTo] IS NULL) = 0
WHERE [e0].[EmployeeID] IS NOT DISTINCT FROM [e].[ReportsTo]) = 0
""");
}

Expand Down Expand Up @@ -2836,7 +2836,7 @@ public override async Task OrderBy_comparison_operator(bool async)
SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM [Customers] AS [c]
ORDER BY CASE
WHEN [c].[Region] = N'ASK' AND [c].[Region] IS NOT NULL THEN CAST(1 AS bit)
WHEN [c].[Region] IS DISTINCT FROM N'ASK' THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END
""");
Expand Down Expand Up @@ -5740,17 +5740,12 @@ SELECT TOP(1) [c0].[CustomerID]
FROM [Orders] AS [o0]
LEFT JOIN [Customers] AS [c0] ON [o0].[CustomerID] = [c0].[CustomerID]
WHERE [c].[CustomerID] = [o0].[CustomerID]
ORDER BY [o0].[OrderDate]) IS NOT NULL AND ((
ORDER BY [o0].[OrderDate]) IS NOT NULL AND (
SELECT TOP(1) [c1].[CustomerID]
FROM [Orders] AS [o1]
LEFT JOIN [Customers] AS [c1] ON [o1].[CustomerID] = [c1].[CustomerID]
WHERE [c].[CustomerID] = [o1].[CustomerID]
ORDER BY [o1].[OrderDate]) = [o].[CustomerID] OR ((
SELECT TOP(1) [c1].[CustomerID]
FROM [Orders] AS [o1]
LEFT JOIN [Customers] AS [c1] ON [o1].[CustomerID] = [c1].[CustomerID]
WHERE [c].[CustomerID] = [o1].[CustomerID]
ORDER BY [o1].[OrderDate]) IS NULL AND [o].[CustomerID] IS NULL)) AND [o].[OrderID] < 11000) THEN CAST(1 AS bit)
ORDER BY [o1].[OrderDate]) IS DISTINCT FROM [o].[CustomerID] AND [o].[OrderID] < 11000) THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [Complex]
FROM [Customers] AS [c]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ SELECT COUNT(*)
FROM [Order Details] AS [o0]
INNER JOIN [Orders] AS [o1] ON [o0].[OrderID] = [o1].[OrderID]
LEFT JOIN [Customers] AS [c0] ON [o1].[CustomerID] = [c0].[CustomerID]
WHERE [c].[Country] = [c0].[Country] OR ([c].[Country] IS NULL AND [c0].[Country] IS NULL)) > 0 AND [o].[OrderID] IN (10643, 10692)
WHERE [c].[Country] IS DISTINCT FROM [c0].[Country]) > 0 AND [o].[OrderID] IN (10643, 10692)
""");
}

Expand Down Expand Up @@ -1086,7 +1086,7 @@ SELECT COUNT(*)
FROM [Order Details] AS [o0]
INNER JOIN [Orders] AS [o1] ON [o0].[OrderID] = [o1].[OrderID]
LEFT JOIN [Customers] AS [c0] ON [o1].[CustomerID] = [c0].[CustomerID]
WHERE [c].[Country] = [c0].[Country] OR ([c].[Country] IS NULL AND [c0].[Country] IS NULL)
WHERE [c].[Country] IS DISTINCT FROM [c0].[Country]
) AS [s]) > 0
""");
}
Expand Down
Loading

0 comments on commit 79e3de6

Please sign in to comment.