Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Dec 15, 2024
1 parent 8afb824 commit 6ba1bab
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 52 deletions.
1 change: 0 additions & 1 deletion EFCore.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ The .NET Foundation licenses this file to you under the MIT license.
<s:Boolean x:Key="/Default/UserDictionary/Words/=uncoalesce/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=uncoalescing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unconfigured/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unequality/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unignore/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=fixup/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=attacher/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ public override Task Conditional_simplifiable_equality(bool async)
{
await base.Conditional_simplifiable_equality(a);

// TODO: Simplify this away, as per #35327 for relational
AssertSql(
"""
SELECT VALUE c
FROM root c
WHERE (c["Int"] > 1)
WHERE (((c["Int"] = 9) ? 9 : c["Int"]) > 1)
""");
});

Expand All @@ -33,11 +34,12 @@ public override Task Conditional_simplifiable_inequality(bool async)
{
await base.Conditional_simplifiable_inequality(a);

// TODO: Simplify this away, as per #35327 for relational
AssertSql(
"""
SELECT VALUE c
FROM root c
WHERE (c["Int"] > 1)
WHERE (((c["Int"] != 8) ? c["Int"] : 8) > 1)
""");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1979,10 +1979,7 @@ public override async Task Optional_navigation_type_compensation_works_with_pred
SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note]
FROM [Tags] AS [t]
LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId]
WHERE CASE
WHEN [g].[HasSoulPatch] = CAST(1 AS bit) THEN CAST(1 AS bit)
ELSE [g].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [g].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand All @@ -1995,10 +1992,7 @@ public override async Task Optional_navigation_type_compensation_works_with_pred
SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note]
FROM [Tags] AS [t]
LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId]
WHERE CASE
WHEN [g].[HasSoulPatch] = CAST(0 AS bit) THEN CAST(0 AS bit)
ELSE [g].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [g].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2205,13 +2205,7 @@ public override async Task Where_equal_with_conditional(bool async)
"""
SELECT [e].[Id]
FROM [Entities1] AS [e]
WHERE CASE
WHEN [e].[NullableStringA] = [e].[NullableStringB] OR ([e].[NullableStringA] IS NULL AND [e].[NullableStringB] IS NULL) THEN [e].[NullableStringA]
ELSE [e].[NullableStringB]
END = [e].[NullableStringC] OR (CASE
WHEN [e].[NullableStringA] = [e].[NullableStringB] OR ([e].[NullableStringA] IS NULL AND [e].[NullableStringB] IS NULL) THEN [e].[NullableStringA]
ELSE [e].[NullableStringB]
END IS NULL AND [e].[NullableStringC] IS NULL)
WHERE [e].[NullableStringB] = [e].[NullableStringC] OR ([e].[NullableStringB] IS NULL AND [e].[NullableStringC] IS NULL)
""");
}

Expand All @@ -2223,16 +2217,7 @@ public override async Task Where_not_equal_with_conditional(bool async)
"""
SELECT [e].[Id]
FROM [Entities1] AS [e]
WHERE ([e].[NullableStringC] <> CASE
WHEN [e].[NullableStringA] = [e].[NullableStringB] OR ([e].[NullableStringA] IS NULL AND [e].[NullableStringB] IS NULL) THEN [e].[NullableStringA]
ELSE [e].[NullableStringB]
END OR [e].[NullableStringC] IS NULL OR CASE
WHEN [e].[NullableStringA] = [e].[NullableStringB] OR ([e].[NullableStringA] IS NULL AND [e].[NullableStringB] IS NULL) THEN [e].[NullableStringA]
ELSE [e].[NullableStringB]
END IS NULL) AND ([e].[NullableStringC] IS NOT NULL OR CASE
WHEN [e].[NullableStringA] = [e].[NullableStringB] OR ([e].[NullableStringA] IS NULL AND [e].[NullableStringB] IS NULL) THEN [e].[NullableStringA]
ELSE [e].[NullableStringB]
END IS NOT NULL)
WHERE ([e].[NullableStringC] <> [e].[NullableStringB] OR [e].[NullableStringC] IS NULL OR [e].[NullableStringB] IS NULL) AND ([e].[NullableStringC] IS NOT NULL OR [e].[NullableStringB] IS NOT NULL)
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2739,10 +2739,7 @@ UNION ALL
SELECT [o].[Nickname], [o].[SquadId], [o].[HasSoulPatch]
FROM [Officers] AS [o]
) AS [u] ON [t].[GearNickName] = [u].[Nickname] AND [t].[GearSquadId] = [u].[SquadId]
WHERE CASE
WHEN [u].[HasSoulPatch] = CAST(1 AS bit) THEN CAST(1 AS bit)
ELSE [u].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [u].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand All @@ -2761,10 +2758,7 @@ UNION ALL
SELECT [o].[Nickname], [o].[SquadId], [o].[HasSoulPatch]
FROM [Officers] AS [o]
) AS [u] ON [t].[GearNickName] = [u].[Nickname] AND [t].[GearSquadId] = [u].[SquadId]
WHERE CASE
WHEN [u].[HasSoulPatch] = CAST(0 AS bit) THEN CAST(0 AS bit)
ELSE [u].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [u].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2361,10 +2361,7 @@ LEFT JOIN (
SELECT [g].[Nickname], [g].[SquadId], [g].[HasSoulPatch]
FROM [Gears] AS [g]
) AS [s] ON [t].[GearNickName] = [s].[Nickname] AND [t].[GearSquadId] = [s].[SquadId]
WHERE CASE
WHEN [s].[HasSoulPatch] = CAST(1 AS bit) THEN CAST(1 AS bit)
ELSE [s].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [s].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand All @@ -2380,10 +2377,7 @@ LEFT JOIN (
SELECT [g].[Nickname], [g].[SquadId], [g].[HasSoulPatch]
FROM [Gears] AS [g]
) AS [s] ON [t].[GearNickName] = [s].[Nickname] AND [t].[GearSquadId] = [s].[SquadId]
WHERE CASE
WHEN [s].[HasSoulPatch] = CAST(0 AS bit) THEN CAST(0 AS bit)
ELSE [s].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [s].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,7 @@ public override async Task Optional_navigation_type_compensation_works_with_pred
SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note], [t].[PeriodEnd], [t].[PeriodStart]
FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t]
LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId]
WHERE CASE
WHEN [g].[HasSoulPatch] = CAST(1 AS bit) THEN CAST(1 AS bit)
ELSE [g].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [g].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand Down Expand Up @@ -1570,10 +1567,7 @@ public override async Task Optional_navigation_type_compensation_works_with_pred
SELECT [t].[Id], [t].[GearNickName], [t].[GearSquadId], [t].[IssueDate], [t].[Note], [t].[PeriodEnd], [t].[PeriodStart]
FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t]
LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId]
WHERE CASE
WHEN [g].[HasSoulPatch] = CAST(0 AS bit) THEN CAST(0 AS bit)
ELSE [g].[HasSoulPatch]
END = CAST(0 AS bit)
WHERE [g].[HasSoulPatch] = CAST(0 AS bit)
""");
}

Expand Down

0 comments on commit 6ba1bab

Please sign in to comment.