diff --git a/test/EFCore.Relational.Specification.Tests/Query/NullSemanticsQueryTestBase.cs b/test/EFCore.Relational.Specification.Tests/Query/NullSemanticsQueryTestBase.cs index 6ce93abfd78..53e80173c62 100644 --- a/test/EFCore.Relational.Specification.Tests/Query/NullSemanticsQueryTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/Query/NullSemanticsQueryTestBase.cs @@ -753,7 +753,7 @@ public virtual Task Where_equal_with_conditional(bool async) ss => ss.Set().Where( e => (e.NullableStringA == e.NullableStringB ? e.NullableStringA - : e.NullableStringB) + : e.NullableStringC) == e.NullableStringC).Select(e => e.Id)); [ConditionalTheory] @@ -765,7 +765,7 @@ public virtual Task Where_not_equal_with_conditional(bool async) e => e.NullableStringC != (e.NullableStringA == e.NullableStringB ? e.NullableStringA - : e.NullableStringB)).Select(e => e.Id)); + : e.NullableStringC)).Select(e => e.Id)); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs index 1de199a3c46..77494e237a0 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NullSemanticsQuerySqlServerTest.cs @@ -2205,7 +2205,13 @@ public override async Task Where_equal_with_conditional(bool async) """ SELECT [e].[Id] FROM [Entities1] AS [e] -WHERE [e].[NullableStringB] = [e].[NullableStringC] OR ([e].[NullableStringB] IS NULL AND [e].[NullableStringC] IS NULL) +WHERE CASE + WHEN [e].[NullableStringA] = [e].[NullableStringB] OR ([e].[NullableStringA] IS NULL AND [e].[NullableStringB] IS NULL) THEN [e].[NullableStringA] + ELSE [e].[NullableStringC] +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].[NullableStringC] +END IS NULL AND [e].[NullableStringC] IS NULL) """); } @@ -2217,7 +2223,16 @@ public override async Task Where_not_equal_with_conditional(bool async) """ SELECT [e].[Id] FROM [Entities1] AS [e] -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) +WHERE ([e].[NullableStringC] <> CASE + WHEN [e].[NullableStringA] = [e].[NullableStringB] OR ([e].[NullableStringA] IS NULL AND [e].[NullableStringB] IS NULL) THEN [e].[NullableStringA] + ELSE [e].[NullableStringC] +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].[NullableStringC] +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].[NullableStringC] +END IS NOT NULL) """); }