Skip to content

Commit

Permalink
Update baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ranma42 committed Jul 9, 2024
1 parent f823808 commit bbe125a
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public override async Task Normal_entity_owning_a_split_reference_with_main_frag
AssertSql(
"""
SELECT [e].[Id], CASE
WHEN [e].[OwnedReference_Id] IS NOT NULL AND [e].[OwnedReference_OwnedIntValue1] IS NOT NULL AND [e].[OwnedReference_OwnedIntValue2] IS NOT NULL AND [o0].[OwnedIntValue3] IS NOT NULL AND [o].[OwnedIntValue4] IS NOT NULL THEN [o].[OwnedIntValue4]
WHEN [e].[OwnedReference_Id] IS NOT NULL AND [e].[OwnedReference_OwnedIntValue1] IS NOT NULL AND [e].[OwnedReference_OwnedIntValue2] IS NOT NULL AND [o0].[OwnedIntValue3] IS NOT NULL THEN [o].[OwnedIntValue4]
END AS [OwnedIntValue4], CASE
WHEN [e].[OwnedReference_Id] IS NOT NULL AND [e].[OwnedReference_OwnedIntValue1] IS NOT NULL AND [e].[OwnedReference_OwnedIntValue2] IS NOT NULL AND [o0].[OwnedIntValue3] IS NOT NULL AND [o].[OwnedIntValue4] IS NOT NULL THEN [o].[OwnedStringValue4]
END AS [OwnedStringValue4]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,7 @@ public override async Task Null_propagation_optimization4(bool async)
"""
SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
FROM [Gears] AS [g]
WHERE CASE
WHEN [g].[LeaderNickname] IS NULL THEN NULL
ELSE CAST(LEN([g].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([g].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1007,9 +1004,7 @@ public override async Task Null_propagation_optimization5(bool async)
"""
SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
FROM [Gears] AS [g]
WHERE CASE
WHEN [g].[LeaderNickname] IS NOT NULL THEN CAST(LEN([g].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([g].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1022,9 +1017,7 @@ public override async Task Null_propagation_optimization6(bool async)
"""
SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank]
FROM [Gears] AS [g]
WHERE CASE
WHEN [g].[LeaderNickname] IS NOT NULL THEN CAST(LEN([g].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([g].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1035,9 +1028,7 @@ public override async Task Select_null_propagation_optimization7(bool async)
// issue #16050
AssertSql(
"""
SELECT CASE
WHEN [g].[LeaderNickname] IS NOT NULL THEN [g].[LeaderNickname] + [g].[LeaderNickname]
END
SELECT [g].[LeaderNickname] + [g].[LeaderNickname]
FROM [Gears] AS [g]
""");
}
Expand Down Expand Up @@ -1214,9 +1205,7 @@ public override async Task Select_null_propagation_works_for_multiple_navigation

AssertSql(
"""
SELECT CASE
WHEN [c].[Name] IS NOT NULL THEN [c].[Name]
END
SELECT [c].[Name]
FROM [Tags] AS [t]
LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId]
LEFT JOIN [Tags] AS [t0] ON ([g].[Nickname] = [t0].[GearNickName] OR ([g].[Nickname] IS NULL AND [t0].[GearNickName] IS NULL)) AND ([g].[SquadId] = [t0].[GearSquadId] OR ([g].[SquadId] IS NULL AND [t0].[GearSquadId] IS NULL))
Expand Down Expand Up @@ -3628,9 +3617,7 @@ public override async Task Select_null_conditional_with_inheritance(bool async)

AssertSql(
"""
SELECT CASE
WHEN [f].[CommanderName] IS NOT NULL THEN [f].[CommanderName]
END
SELECT [f].[CommanderName]
FROM [Factions] AS [f]
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2499,9 +2499,7 @@ public override async Task GroupBy_group_Where_Select_Distinct_aggregate(bool as

AssertSql(
"""
SELECT [o].[CustomerID] AS [Key], MAX(DISTINCT (CASE
WHEN [o].[OrderDate] IS NOT NULL THEN [o].[OrderDate]
END)) AS [Max]
SELECT [o].[CustomerID] AS [Key], MAX(DISTINCT ([o].[OrderDate])) AS [Max]
FROM [Orders] AS [o]
GROUP BY [o].[CustomerID]
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4429,9 +4429,7 @@ public override async Task Is_not_null_optimizes_unary_op(bool async)

AssertSql(
"""
SELECT CASE
WHEN [e].[NullableIntA] IS NOT NULL THEN ~[e].[NullableIntA]
END
SELECT ~[e].[NullableIntA]
FROM [Entities1] AS [e]
""");
}
Expand All @@ -4442,9 +4440,7 @@ public override async Task Is_not_null_optimizes_binary_op(bool async)

AssertSql(
"""
SELECT CASE
WHEN [e].[NullableIntA] IS NOT NULL AND [e].[NullableIntB] IS NOT NULL THEN [e].[NullableIntA] + [e].[NullableIntB]
END
SELECT [e].[NullableIntA] + [e].[NullableIntB]
FROM [Entities1] AS [e]
""");
}
Expand All @@ -4455,9 +4451,7 @@ public override async Task Is_not_null_optimizes_binary_op_with_partial_checks(b

AssertSql(
"""
SELECT CASE
WHEN [e].[NullableStringA] IS NOT NULL AND [e].[NullableStringB] IS NOT NULL THEN [e].[NullableStringA] + [e].[NullableStringB] + COALESCE([e].[NullableStringC], N'')
END
SELECT [e].[NullableStringA] + [e].[NullableStringB] + COALESCE([e].[NullableStringC], N'')
FROM [Entities1] AS [e]
""");
}
Expand All @@ -4468,11 +4462,7 @@ public override async Task Is_not_null_optimizes_binary_op_with_nested_checks(bo

AssertSql(
"""
SELECT CASE
WHEN [e].[NullableStringA] IS NOT NULL THEN CASE
WHEN [e].[NullableStringB] IS NOT NULL THEN [e].[NullableStringA] + [e].[NullableStringB]
END
END
SELECT [e].[NullableStringA] + [e].[NullableStringB]
FROM [Entities1] AS [e]
""");
}
Expand All @@ -4484,7 +4474,7 @@ public override async Task Is_not_null_optimizes_binary_op_with_mixed_checks(boo
AssertSql(
"""
SELECT CASE
WHEN [e].[NullableStringA] IS NOT NULL AND [e].[BoolA] = CAST(1 AS bit) THEN [e].[NullableStringA] + COALESCE([e].[NullableStringB], N'')
WHEN [e].[BoolA] = CAST(1 AS bit) THEN [e].[NullableStringA] + COALESCE([e].[NullableStringB], N'')
END
FROM [Entities1] AS [e]
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ public override async Task AsBinary_with_null_check(bool async)

AssertSql(
"""
SELECT [p].[Id], CASE
WHEN [p].[Point] IS NULL THEN NULL
ELSE [p].[Point].STAsBinary()
END AS [Binary]
SELECT [p].[Id], [p].[Point].STAsBinary() AS [Binary]
FROM [PointEntity] AS [p]
""");
}
Expand Down Expand Up @@ -285,10 +282,7 @@ public override async Task Disjoint_with_null_check(bool async)
"""
@__point_0='0xE6100000010C000000000000F03F000000000000F03F' (Size = 22) (DbType = Object)
SELECT [p].[Id], CASE
WHEN [p].[Polygon] IS NULL THEN NULL
ELSE [p].[Polygon].STDisjoint(@__point_0)
END AS [Disjoint]
SELECT [p].[Id], [p].[Polygon].STDisjoint(@__point_0) AS [Disjoint]
FROM [PolygonEntity] AS [p]
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ public override async Task AsBinary_with_null_check(bool async)

AssertSql(
"""
SELECT [p].[Id], CASE
WHEN [p].[Point] IS NULL THEN NULL
ELSE [p].[Point].STAsBinary()
END AS [Binary]
SELECT [p].[Id], [p].[Point].STAsBinary() AS [Binary]
FROM [PointEntity] AS [p]
""");
}
Expand Down Expand Up @@ -404,10 +401,7 @@ public override async Task Disjoint_with_null_check(bool async)
"""
@__point_0='0x00000000010C000000000000F03F000000000000F03F' (Size = 22) (DbType = Object)
SELECT [p].[Id], CASE
WHEN [p].[Polygon] IS NULL THEN NULL
ELSE [p].[Polygon].STDisjoint(@__point_0)
END AS [Disjoint]
SELECT [p].[Id], [p].[Polygon].STDisjoint(@__point_0) AS [Disjoint]
FROM [PolygonEntity] AS [p]
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1383,10 +1383,7 @@ UNION ALL
SELECT [o].[Nickname], [o].[SquadId], [o].[AssignedCityName], [o].[CityOfBirthName], [o].[FullName], [o].[HasSoulPatch], [o].[LeaderNickname], [o].[LeaderSquadId], [o].[Rank], N'Officer' AS [Discriminator]
FROM [Officers] AS [o]
) AS [u]
WHERE CASE
WHEN [u].[LeaderNickname] IS NULL THEN NULL
ELSE CAST(LEN([u].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([u].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1405,9 +1402,7 @@ UNION ALL
SELECT [o].[Nickname], [o].[SquadId], [o].[AssignedCityName], [o].[CityOfBirthName], [o].[FullName], [o].[HasSoulPatch], [o].[LeaderNickname], [o].[LeaderSquadId], [o].[Rank], N'Officer' AS [Discriminator]
FROM [Officers] AS [o]
) AS [u]
WHERE CASE
WHEN [u].[LeaderNickname] IS NOT NULL THEN CAST(LEN([u].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([u].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1426,9 +1421,7 @@ UNION ALL
SELECT [o].[Nickname], [o].[SquadId], [o].[AssignedCityName], [o].[CityOfBirthName], [o].[FullName], [o].[HasSoulPatch], [o].[LeaderNickname], [o].[LeaderSquadId], [o].[Rank], N'Officer' AS [Discriminator]
FROM [Officers] AS [o]
) AS [u]
WHERE CASE
WHEN [u].[LeaderNickname] IS NOT NULL THEN CAST(LEN([u].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([u].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1439,9 +1432,7 @@ public override async Task Select_null_propagation_optimization7(bool async)
// issue #16050
AssertSql(
"""
SELECT CASE
WHEN [u].[LeaderNickname] IS NOT NULL THEN [u].[LeaderNickname] + [u].[LeaderNickname]
END
SELECT [u].[LeaderNickname] + [u].[LeaderNickname]
FROM (
SELECT [g].[LeaderNickname]
FROM [Gears] AS [g]
Expand Down Expand Up @@ -1720,9 +1711,7 @@ public override async Task Select_null_propagation_works_for_multiple_navigation

AssertSql(
"""
SELECT CASE
WHEN [c].[Name] IS NOT NULL THEN [c].[Name]
END
SELECT [c].[Name]
FROM [Tags] AS [t]
LEFT JOIN (
SELECT [g].[Nickname], [g].[SquadId]
Expand Down Expand Up @@ -4841,9 +4830,7 @@ public override async Task Select_null_conditional_with_inheritance(bool async)

AssertSql(
"""
SELECT CASE
WHEN [l].[CommanderName] IS NOT NULL THEN [l].[CommanderName]
END
SELECT [l].[CommanderName]
FROM [LocustHordes] AS [l]
""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1204,10 +1204,7 @@ WHEN [o].[Nickname] IS NOT NULL THEN N'Officer'
END AS [Discriminator]
FROM [Gears] AS [g]
LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId]
WHERE CASE
WHEN [g].[LeaderNickname] IS NULL THEN NULL
ELSE CAST(LEN([g].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([g].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1223,9 +1220,7 @@ WHEN [o].[Nickname] IS NOT NULL THEN N'Officer'
END AS [Discriminator]
FROM [Gears] AS [g]
LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId]
WHERE CASE
WHEN [g].[LeaderNickname] IS NOT NULL THEN CAST(LEN([g].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([g].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1241,9 +1236,7 @@ WHEN [o].[Nickname] IS NOT NULL THEN N'Officer'
END AS [Discriminator]
FROM [Gears] AS [g]
LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId]
WHERE CASE
WHEN [g].[LeaderNickname] IS NOT NULL THEN CAST(LEN([g].[LeaderNickname]) AS int)
END = 5
WHERE CAST(LEN([g].[LeaderNickname]) AS int) = 5
""");
}

Expand All @@ -1254,9 +1247,7 @@ public override async Task Select_null_propagation_optimization7(bool async)
// issue #16050
AssertSql(
"""
SELECT CASE
WHEN [g].[LeaderNickname] IS NOT NULL THEN [g].[LeaderNickname] + [g].[LeaderNickname]
END
SELECT [g].[LeaderNickname] + [g].[LeaderNickname]
FROM [Gears] AS [g]
""");
}
Expand Down Expand Up @@ -1451,9 +1442,7 @@ public override async Task Select_null_propagation_works_for_multiple_navigation

AssertSql(
"""
SELECT CASE
WHEN [c].[Name] IS NOT NULL THEN [c].[Name]
END
SELECT [c].[Name]
FROM [Tags] AS [t]
LEFT JOIN (
SELECT [g].[Nickname], [g].[SquadId]
Expand Down Expand Up @@ -4133,9 +4122,7 @@ public override async Task Select_null_conditional_with_inheritance(bool async)

AssertSql(
"""
SELECT CASE
WHEN [l].[CommanderName] IS NOT NULL THEN [l].[CommanderName]
END
SELECT [l].[CommanderName]
FROM [Factions] AS [f]
LEFT JOIN [LocustHordes] AS [l] ON [f].[Id] = [l].[Id]
WHERE [l].[Id] IS NOT NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1848,9 +1848,9 @@ public override async Task LeftJoin_with_Any_on_outer_source_and_projecting_coll
SELECT CASE
WHEN [s].[OneToOne_Required_PK_Date] IS NULL OR [s].[Level1_Required_Id] IS NULL OR [s].[OneToMany_Required_Inverse2Id] IS NULL OR CASE
WHEN [s].[PeriodEnd0] IS NOT NULL AND [s].[PeriodStart0] IS NOT NULL THEN [s].[PeriodEnd0]
WHEN [s].[PeriodStart0] IS NOT NULL THEN [s].[PeriodEnd0]
END IS NULL OR CASE
WHEN [s].[PeriodEnd0] IS NOT NULL AND [s].[PeriodStart0] IS NOT NULL THEN [s].[PeriodStart0]
WHEN [s].[PeriodEnd0] IS NOT NULL THEN [s].[PeriodStart0]
END IS NULL THEN 0
WHEN [s].[OneToOne_Required_PK_Date] IS NOT NULL AND [s].[Level1_Required_Id] IS NOT NULL AND [s].[OneToMany_Required_Inverse2Id] IS NOT NULL AND [s].[PeriodEnd0] IS NOT NULL AND [s].[PeriodStart0] IS NOT NULL THEN [s].[Id0]
END, [l].[Id], [s].[Id], [s].[Id0], [l4].[Id], [l4].[Level2_Optional_Id], [l4].[Level2_Required_Id], [l4].[Level3_Name], [l4].[OneToMany_Optional_Inverse3Id], [l4].[OneToMany_Required_Inverse3Id], [l4].[OneToOne_Optional_PK_Inverse3Id], [l4].[PeriodEnd], [l4].[PeriodStart]
Expand All @@ -1866,9 +1866,9 @@ WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id]
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]
END
WHERE [l2].[OneToOne_Required_PK_Date] IS NOT NULL AND [l2].[Level1_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse2Id] IS NOT NULL AND CASE
WHEN [l2].[PeriodEnd] IS NOT NULL AND [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodEnd]
WHEN [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodEnd]
END IS NOT NULL AND CASE
WHEN [l2].[PeriodEnd] IS NOT NULL AND [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodStart]
WHEN [l2].[PeriodEnd] IS NOT NULL THEN [l2].[PeriodStart]
END IS NOT NULL
) AS [s] ON [l].[Id] = [s].[Level1_Required_Id]
LEFT JOIN (
Expand Down Expand Up @@ -2251,9 +2251,9 @@ public override async Task Null_check_in_anonymous_type_projection_should_not_be
LEFT JOIN (
SELECT CASE
WHEN [l2].[Level2_Required_Id] IS NULL OR [l2].[OneToMany_Required_Inverse3Id] IS NULL OR CASE
WHEN [l2].[PeriodEnd] IS NOT NULL AND [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodEnd]
WHEN [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodEnd]
END IS NULL OR CASE
WHEN [l2].[PeriodEnd] IS NOT NULL AND [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodStart]
WHEN [l2].[PeriodEnd] IS NOT NULL THEN [l2].[PeriodStart]
END IS NULL THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [c], [l2].[Level3_Name], [l0].[Id], [l2].[Id] AS [Id0], [l0].[OneToMany_Optional_Inverse2Id]
Expand Down Expand Up @@ -2282,9 +2282,9 @@ public override async Task Null_check_in_Dto_projection_should_not_be_removed(bo
LEFT JOIN (
SELECT CASE
WHEN [l2].[Level2_Required_Id] IS NULL OR [l2].[OneToMany_Required_Inverse3Id] IS NULL OR CASE
WHEN [l2].[PeriodEnd] IS NOT NULL AND [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodEnd]
WHEN [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodEnd]
END IS NULL OR CASE
WHEN [l2].[PeriodEnd] IS NOT NULL AND [l2].[PeriodStart] IS NOT NULL THEN [l2].[PeriodStart]
WHEN [l2].[PeriodEnd] IS NOT NULL THEN [l2].[PeriodStart]
END IS NULL THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END AS [c], [l2].[Level3_Name], [l0].[Id], [l2].[Id] AS [Id0], [l0].[OneToMany_Optional_Inverse2Id]
Expand Down
Loading

0 comments on commit bbe125a

Please sign in to comment.